mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-12-08 16:32:21 +00:00
[commands] Properly eject listeners with custom names
This commit is contained in:
@@ -461,8 +461,8 @@ class Cog(metaclass=CogMeta):
|
|||||||
if command.parent is None:
|
if command.parent is None:
|
||||||
bot.remove_command(command.name)
|
bot.remove_command(command.name)
|
||||||
|
|
||||||
for _, method_name in self.__cog_listeners__:
|
for name, method_name in self.__cog_listeners__:
|
||||||
bot.remove_listener(getattr(self, method_name))
|
bot.remove_listener(getattr(self, method_name), name)
|
||||||
|
|
||||||
if cls.bot_check is not Cog.bot_check:
|
if cls.bot_check is not Cog.bot_check:
|
||||||
bot.remove_check(self.bot_check)
|
bot.remove_check(self.bot_check)
|
||||||
|
|||||||
Reference in New Issue
Block a user