mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Add CategoryChannel.forums shortcut property
This commit is contained in:
parent
14faa9bdab
commit
b7785d29cb
@ -1971,6 +1971,16 @@ class CategoryChannel(discord.abc.GuildChannel, Hashable):
|
||||
ret.sort(key=lambda c: (c.position, c.id))
|
||||
return ret
|
||||
|
||||
@property
|
||||
def forums(self) -> List[ForumChannel]:
|
||||
"""List[:class:`ForumChannel`]: Returns the forum channels that are under this category.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
"""
|
||||
r = [c for c in self.guild.channels if c.category_id == self.id and isinstance(c, ForumChannel)]
|
||||
r.sort(key=lambda c: (c.position, c.id))
|
||||
return r
|
||||
|
||||
async def create_text_channel(self, name: str, **options: Any) -> TextChannel:
|
||||
"""|coro|
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user