diff options
| author | Rapptz <[email protected]> | 2021-04-14 05:05:47 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-06-08 07:23:40 -0400 |
| commit | 68c7c538f5a4e068664c3ee2f38f7343e229af1a (patch) | |
| tree | 08a694d1f32e27283e08302ab1388d8579a1bb0c /discord/channel.py | |
| parent | [types] Add support thread API typings (diff) | |
| download | discord.py-68c7c538f5a4e068664c3ee2f38f7343e229af1a.tar.xz discord.py-68c7c538f5a4e068664c3ee2f38f7343e229af1a.zip | |
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.
Diffstat (limited to 'discord/channel.py')
| -rw-r--r-- | discord/channel.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/discord/channel.py b/discord/channel.py index 743619f4..5179c8c4 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -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 |