From cd1dd7d6704aa0c99cc4507b34461372061f9cf6 Mon Sep 17 00:00:00 2001 From: mniip Date: Tue, 22 Feb 2022 05:42:00 +0300 Subject: [PATCH] [commands] Properly eject listeners with custom names --- discord/ext/commands/cog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 12c9ab36d..5516c31ec 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -461,8 +461,8 @@ class Cog(metaclass=CogMeta): if command.parent is None: bot.remove_command(command.name) - for _, method_name in self.__cog_listeners__: - bot.remove_listener(getattr(self, method_name)) + for name, method_name in self.__cog_listeners__: + bot.remove_listener(getattr(self, method_name), name) if cls.bot_check is not Cog.bot_check: bot.remove_check(self.bot_check)