[commands] Properly eject listeners with custom names

This commit is contained in:
mniip 2022-02-22 05:42:00 +03:00 committed by GitHub
parent 40dc8d1d9d
commit cd1dd7d670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)