Browse Source

[commands] Make Command a descriptor for #426.

pull/468/head
Rapptz 8 years ago
parent
commit
695b62ccd3
  1. 2
      discord/ext/commands/bot.py
  2. 5
      discord/ext/commands/core.py

2
discord/ext/commands/bot.py

@ -417,7 +417,6 @@ class BotBase(GroupMixin):
for name, member in members:
# register commands the cog has
if isinstance(member, Command):
member.instance = cog
if member.parent is None:
self.add_command(member)
continue
@ -465,7 +464,6 @@ class BotBase(GroupMixin):
for name, member in members:
# remove commands the cog has
if isinstance(member, Command):
member.instance = None
if member.parent is None:
self.remove_command(member.name)
continue

5
discord/ext/commands/core.py

@ -160,6 +160,11 @@ class Command:
finally:
ctx.bot.dispatch('command_error', error, ctx)
def __get__(self, instance, owner):
if instance is not None:
self.instance = instance
return self
@asyncio.coroutine
def do_conversion(self, ctx, converter, argument):
if converter is bool:

Loading…
Cancel
Save