aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-02-28 17:42:07 -0500
committerRapptz <[email protected]>2017-02-28 17:42:07 -0500
commit39d65305a346977736074896837f06df0043d76c (patch)
tree1d36dde45a64f4316f097320e7f552217e391ae3
parentRename VoiceChannel.voice_members to VoiceChannel.members (diff)
downloaddiscord.py-39d65305a346977736074896837f06df0043d76c.tar.xz
discord.py-39d65305a346977736074896837f06df0043d76c.zip
Add TextChannel.members to get members that can see a channel.
-rw-r--r--discord/channel.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/channel.py b/discord/channel.py
index fd1f61f7..67259f44 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -109,6 +109,11 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
permissions_for.__doc__ = discord.abc.GuildChannel.permissions_for.__doc__
+ @property
+ def members(self):
+ """Returns a list of :class:`Member` that can see this channel."""
+ return [m for m in self.guild.members if self.permissions_for(m).read_messages]
+
@asyncio.coroutine
def edit(self, **options):
"""|coro|