From 68c7c538f5a4e068664c3ee2f38f7343e229af1a Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 14 Apr 2021 05:05:47 -0400 Subject: 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. --- discord/channel.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'discord/channel.py') 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 -- cgit v1.2.3