[commands] Fix attribute access in cogs to commands.

Previously they were outdated copies, this updates the copies to the
ones that are actually injected.
This commit is contained in:
Rapptz 2019-02-23 07:38:04 -05:00
parent 04ee10adc4
commit 1a0b1dfd29

View File

@ -135,6 +135,10 @@ class Cog(metaclass=CogMeta):
# Either update the command with the cog provided defaults or copy it.
self.__cog_commands__ = tuple(c._update_copy(cmd_attrs) for c in cls.__cog_commands__)
# Update the Command instances dynamically as well
for command in self.__cog_commands__:
setattr(self, command.callback.__name__, command)
return self
def get_commands(self):