diff options
| author | Rapptz <[email protected]> | 2019-02-23 07:38:04 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-02-23 07:38:04 -0500 |
| commit | 1a0b1dfd294a94d8918e9bfd45c0f11a99c7ca6c (patch) | |
| tree | 6f2d6f6e4c730f6e2b7a02b734f5c06eb2f12a43 /discord/ext/commands/cog.py | |
| parent | [commands] Fix bug with local checks and cooldowns not applying. (diff) | |
| download | discord.py-1a0b1dfd294a94d8918e9bfd45c0f11a99c7ca6c.tar.xz discord.py-1a0b1dfd294a94d8918e9bfd45c0f11a99c7ca6c.zip | |
[commands] Fix attribute access in cogs to commands.
Previously they were outdated copies, this updates the copies to the
ones that are actually injected.
Diffstat (limited to 'discord/ext/commands/cog.py')
| -rw-r--r-- | discord/ext/commands/cog.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 80662338..ace94f18 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -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): |