From 1a0b1dfd294a94d8918e9bfd45c0f11a99c7ca6c Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 23 Feb 2019 07:38:04 -0500 Subject: [PATCH] [commands] Fix attribute access in cogs to commands. Previously they were outdated copies, this updates the copies to the ones that are actually injected. --- discord/ext/commands/cog.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 806623382..ace94f183 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):