@@ -90,26 +90,26 @@ async def register_all_commands(self):
90
90
self .logger .info ("Registering commands..." )
91
91
for x in self .commands .keys ():
92
92
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" ):
94
94
# Just in case it has subcommands but also has base command.
95
95
# More specific, it will skip if it has subcommands and doesn't have base command coroutine.
96
96
self .logger .debug ("Skipping registering subcommands." )
97
97
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 :
100
100
await manage_commands .add_slash_command (self ._discord .user .id ,
101
101
self ._discord .http .token ,
102
102
y ,
103
103
x ,
104
- selected [ " description" ] ,
105
- selected [ "api_options" ] )
104
+ selected . description ,
105
+ selected . options )
106
106
else :
107
107
await manage_commands .add_slash_command (self ._discord .user .id ,
108
108
self ._discord .http .token ,
109
109
None ,
110
110
x ,
111
- selected [ " description" ] ,
112
- selected [ "api_options" ] )
111
+ selected . description ,
112
+ selected . options )
113
113
self .logger .info ("Completed registering all commands!" )
114
114
115
115
def add_slash_command (self ,
@@ -203,8 +203,8 @@ def add_subcommand(self,
203
203
if base not in self .commands .keys ():
204
204
self .commands [base ] = model .CommandObject (base , _cmd )
205
205
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
208
208
if base not in self .subcommands .keys ():
209
209
self .subcommands [base ] = {}
210
210
if subcommand_group :
0 commit comments