aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-10-12 21:11:45 -0400
committerRapptz <[email protected]>2017-01-03 09:51:51 -0500
commit20251c54a76810a030ea2604cedc88a6e66a11cc (patch)
treeaa4fd3fa89fffc8da0aba5f8d99d1af7af7be22c
parentSlots use tuples instead now. (diff)
downloaddiscord.py-20251c54a76810a030ea2604cedc88a6e66a11cc.tar.xz
discord.py-20251c54a76810a030ea2604cedc88a6e66a11cc.zip
[commands] Bot skip check now works with the new __eq__ changes.
-rw-r--r--discord/ext/commands/bot.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index b0a86ebd..1f4b355f 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -215,7 +215,10 @@ class Bot(GroupMixin, discord.Client):
self.command_not_found = options.pop('command_not_found', 'No command called "{}" found.')
self.command_has_no_subcommands = options.pop('command_has_no_subcommands', 'Command {0.name} has no subcommands.')
- self._skip_check = discord.User.__ne__ if options.pop('self_bot', False) else discord.User.__eq__
+ if options.pop('self_bot', False):
+ self._skip_check = lambda x, y: x != y
+ else:
+ self._skip_check = lambda x, y: x == y
self.help_attrs = options.pop('help_attrs', {})
self.help_attrs['pass_context'] = True
@@ -815,7 +818,7 @@ class Bot(GroupMixin, discord.Client):
_internal_author = message.author
view = StringView(message.content)
- if self._skip_check(message.author, self.user):
+ if self._skip_check(message.author.id, self.user.id):
return
prefix = yield from self._get_prefix(message)