aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--discord/abc.py5
-rw-r--r--discord/channel.py10
2 files changed, 10 insertions, 5 deletions
diff --git a/discord/abc.py b/discord/abc.py
index 89229279..7814772a 100644
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -346,11 +346,6 @@ class GuildChannel:
denied = Permissions.all_channel()
base.value &= ~denied.value
- # text channels do not have voice related permissions
- if isinstance(self, TextChannel):
- denied = Permissions.voice()
- base.value &= ~denied.value
-
return base
@asyncio.coroutine
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|