[commands] bot_has_permissions decorator actually checks for bot.

This commit is contained in:
Rapptz 2016-03-02 21:54:56 -05:00
parent 3802e7f534
commit f49dc81adf

View File

@ -841,6 +841,6 @@ def bot_has_permissions(**perms):
def predicate(ctx): def predicate(ctx):
ch = ctx.message.channel ch = ctx.message.channel
me = msg.server.me if not ch.is_private else ctx.bot.user me = msg.server.me if not ch.is_private else ctx.bot.user
permissions = ch.permissions_for(msg.author) permissions = ch.permissions_for(me)
return all(getattr(permissions, perm, None) == value for perm, value in perms.items()) return all(getattr(permissions, perm, None) == value for perm, value in perms.items())
return check(predicate) return check(predicate)