@@ -90,26 +90,26 @@ async def register_all_commands(self):
9090 self .logger .info ("Registering commands..." )
9191 for x in self .commands .keys ():
9292 selected = self .commands [x ]
93- if selected [ " has_subcommands" ] and "func" not in selected . keys ( ):
93+ if selected . has_subcommands and not hasattr ( selected , "invoke" ):
9494 # Just in case it has subcommands but also has base command.
9595 # More specific, it will skip if it has subcommands and doesn't have base command coroutine.
9696 self .logger .debug ("Skipping registering subcommands." )
9797 continue
98- if selected [ "guild_ids" ] :
99- for y in selected [ "guild_ids" ] :
98+ if selected . allowed_guild_ids :
99+ for y in selected . allowed_guild_ids :
100100 await manage_commands .add_slash_command (self ._discord .user .id ,
101101 self ._discord .http .token ,
102102 y ,
103103 x ,
104- selected [ " description" ] ,
105- selected [ "api_options" ] )
104+ selected . description ,
105+ selected . options )
106106 else :
107107 await manage_commands .add_slash_command (self ._discord .user .id ,
108108 self ._discord .http .token ,
109109 None ,
110110 x ,
111- selected [ " description" ] ,
112- selected [ "api_options" ] )
111+ selected . description ,
112+ selected . options )
113113 self .logger .info ("Completed registering all commands!" )
114114
115115 def add_slash_command (self ,
@@ -203,8 +203,8 @@ def add_subcommand(self,
203203 if base not in self .commands .keys ():
204204 self .commands [base ] = model .CommandObject (base , _cmd )
205205 else :
206- self .subcommands [base ].has_subcommands = True
207- self .subcommands [base ].guild_ids += guild_ids
206+ self .commands [base ].has_subcommands = True
207+ self .commands [base ].allowed_guild_ids += guild_ids
208208 if base not in self .subcommands .keys ():
209209 self .subcommands [base ] = {}
210210 if subcommand_group :
0 commit comments