From 33470ff1960285b5e5d5e0b277ee76a1e71dc1e2 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 2 Sep 2021 22:41:26 +0200 Subject: [PATCH] Merge pull request #31 * Add bots and humans to TextChannel --- discord/channel.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/discord/channel.py b/discord/channel.py index dc3967c4..f467d1cc 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -228,6 +228,16 @@ 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 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 def threads(self) -> List[Thread]: """List[:class:`Thread`]: Returns all the threads that you can see.