mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Add Guild.forums property
Ran an informal poll in the official server and this name won over the alternative Guild.forum_channels property name
This commit is contained in:
parent
7a52aa3764
commit
d98ee567d4
@ -632,6 +632,16 @@ class Guild(Hashable):
|
||||
r.sort(key=lambda c: (c.position, c.id))
|
||||
return r
|
||||
|
||||
@property
|
||||
def forums(self) -> List[ForumChannel]:
|
||||
"""List[:class:`ForumChannel`]: A list of forum channels that belongs to this guild.
|
||||
|
||||
This is sorted by the position and are in UI order from top to bottom.
|
||||
"""
|
||||
r = [ch for ch in self._channels.values() if isinstance(ch, ForumChannel)]
|
||||
r.sort(key=lambda c: (c.position, c.id))
|
||||
return r
|
||||
|
||||
def by_category(self) -> List[ByCategoryItem]:
|
||||
"""Returns every :class:`CategoryChannel` and their associated channels.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user