mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-12-03 14:02:19 +00:00
First pass at preliminary thread support
This is missing a lot of functionality right now, such as two gateway events and all the HTTP CRUD endpoints.
This commit is contained in:
@@ -173,6 +173,14 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
||||
"""List[:class:`Member`]: Returns all members that can see this channel."""
|
||||
return [m for m in self.guild.members if self.permissions_for(m).read_messages]
|
||||
|
||||
@property
|
||||
def threads(self):
|
||||
"""List[:class:`Thread`]: Returns all the threads that you can see.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
"""
|
||||
return [thread for thread in self.guild.threads if thread.parent_id == self.id]
|
||||
|
||||
def is_nsfw(self):
|
||||
""":class:`bool`: Checks if the channel is NSFW."""
|
||||
return self.nsfw
|
||||
|
||||
Reference in New Issue
Block a user