aboutsummaryrefslogtreecommitdiff
path: root/discord/channel.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-01-03 20:17:41 -0500
committerRapptz <[email protected]>2017-01-03 20:17:59 -0500
commitd086b5421dbba32e6117586218786b1a03548670 (patch)
treeddd87d520de1a55e2edd147017bf947c2df4bfd9 /discord/channel.py
parentFix bug that made member roles go missing. (diff)
downloaddiscord.py-d086b5421dbba32e6117586218786b1a03548670.tar.xz
discord.py-d086b5421dbba32e6117586218786b1a03548670.zip
Fix NameError when dealing with permission resolution.
Diffstat (limited to 'discord/channel.py')
-rw-r--r--discord/channel.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/discord/channel.py b/discord/channel.py
index 8efae546..998b70d1 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -95,6 +95,16 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
def _get_guild_id(self):
return self.guild.id
+ def permissions_for(self, member):
+ base = super().permissions_for(member)
+
+ # text channels do not have voice related permissions
+ denied = Permissions.voice()
+ base.value &= ~denied.value
+ return base
+
+ permissions_for.__doc__ = discord.abc.GuildChannel.permissions_for.__doc__
+
@asyncio.coroutine
def edit(self, **options):
"""|coro|