Skip to content

Commit 3ed72de

Browse files
committed
Add user_bot kwarg
1 parent 49be12f commit 3ed72de

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

discord/ext/commands/bot.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,16 @@ def __init__(self, command_prefix, help_command=_default, description=None, **op
116116
if self.owner_ids and not isinstance(self.owner_ids, collections.abc.Collection):
117117
raise TypeError('owner_ids must be a collection not {0.__class__!r}'.format(self.owner_ids))
118118

119-
self.self_bot = self_bot = options.pop('self_bot', False)
119+
self_bot = options.get('self_bot', False)
120+
user_bot = options.get('user_bot', False)
121+
122+
if self_bot and user_bot:
123+
raise TypeError('Both self_bot and user_bot are set.')
120124

121125
if self_bot:
122126
self._skip_check = lambda x, y: x != y
127+
elif user_bot:
128+
self._skip_check = lambda x, y: False
123129
else:
124130
self._skip_check = lambda x, y: x == y
125131

@@ -317,8 +323,6 @@ async def is_owner(self, user):
317323
return user.id == self.owner_id
318324
elif self.owner_ids:
319325
return user.id in self.owner_ids
320-
elif self.self_bot:
321-
return user.id == self.user.id
322326
else:
323327
raise AttributeError('Owners aren\'t set.')
324328

0 commit comments

Comments
 (0)