Merge pull request #31

* Add bots and humans to TextChannel
This commit is contained in:
Arthur 2021-09-02 22:41:26 +02:00 committed by GitHub
parent 47e42d1648
commit 33470ff196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,6 +228,16 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
"""List[:class:`Member`]: Returns all members that can see this channel.""" """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] return [m for m in self.guild.members if self.permissions_for(m).read_messages]
@property
def bots(self) -> List[Member]:
"""List[:class:`Member`]: Returns all bots that can see this channel."""
return [m for m in self.guild.members if m.bot and self.permissions_for(m).read_messages]
@property
def humans(self) -> List[Member]:
"""List[:class:`Member`]: Returns all human members that can see this channel."""
return [m for m in self.guild.members if not m.bot and self.permissions_for(m).read_messages]
@property @property
def threads(self) -> List[Thread]: def threads(self) -> List[Thread]:
"""List[:class:`Thread`]: Returns all the threads that you can see. """List[:class:`Thread`]: Returns all the threads that you can see.