Fix NameError when dealing with permission resolution.

This commit is contained in:
Rapptz 2017-01-03 20:17:41 -05:00
parent c863d93f69
commit d086b5421d
2 changed files with 10 additions and 5 deletions

View File

@ -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

View File

@ -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|