@@ -72,16 +72,30 @@ def get_cog_commands(self, cog: commands.Cog):
7272 if x .base in self .commands .keys ():
7373 self .commands [x .base ].allowed_guild_ids += x .allowed_guild_ids
7474 self .commands [x .base ].has_subcommands = True
75+ else :
76+ _cmd = {
77+ "func" : None ,
78+ "description" : "No description." ,
79+ "auto_convert" : {},
80+ "guild_ids" : x .allowed_guild_ids ,
81+ "api_options" : [],
82+ "has_subcommands" : True
83+ }
84+ self .commands [x .base ] = model .CommandObject (x .base , _cmd )
7585 if x .base not in self .subcommands .keys ():
7686 self .subcommands [x .base ] = {}
7787 if x .subcommand_group :
7888 if x .subcommand_group not in self .subcommands :
7989 self .subcommands [x .base ][x .subcommand_group ] = {}
80- else :
81- self .subcommands [x .base ][x .subcommand_group ][x .name ] = x
90+ self .subcommands [x .base ][x .subcommand_group ][x .name ] = x
8291 else :
8392 self .subcommands [x .base ][x .name ] = x
8493
94+ def remove_cog_commands (self , cog ):
95+ func_list = [getattr (cog , x ) for x in dir (cog )]
96+ res = [x for x in func_list if
97+ isinstance (x , model .CogCommandObject ) or isinstance (x , model .CogSubcommandObject )]
98+
8599 async def register_all_commands (self ):
86100 """
87101 Registers all slash commands except subcommands to Discord API.\n
@@ -188,7 +202,7 @@ def add_subcommand(self,
188202 name = name .lower ()
189203 _cmd = {
190204 "func" : None ,
191- "description" : description if description else "No description." ,
205+ "description" : "No description." ,
192206 "auto_convert" : {},
193207 "guild_ids" : guild_ids ,
194208 "api_options" : [],
0 commit comments