[commands] Automatically unload top level app commands in extensions

This commit is contained in:
Rapptz
2022-03-12 09:24:26 -05:00
parent a672455ca9
commit 0ef369c0fa
5 changed files with 55 additions and 7 deletions

View File

@ -263,6 +263,8 @@ class Cog(metaclass=CogMeta):
if cls.__cog_is_app_commands_group__:
# Dynamic attribute setting
self.__discord_app_commands_group_children__ = children # type: ignore
# Enforce this to work even if someone forgets __init__
self.module = cls.__module__ # type: ignore
return self