File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -118,11 +118,8 @@ def add_application_command(self, command: ApplicationCommand) -> None:
118
118
command: :class:`.ApplicationCommand`
119
119
The command to add.
120
120
"""
121
- try :
122
- if getattr (command , "parent" ) is not None :
123
- raise TypeError ("The provided command is a sub-command of group" )
124
- except AttributeError :
125
- pass
121
+ if isinstance (command , SlashCommand ) and command .is_subcommand :
122
+ raise TypeError ("The provided command is a sub-command of group" )
126
123
127
124
if self .debug_guilds and command .guild_ids is None :
128
125
command .guild_ids = self .debug_guilds
@@ -514,7 +511,6 @@ def application_command(self, **kwargs):
514
511
"""
515
512
516
513
def decorator (func ) -> ApplicationCommand :
517
- kwargs .setdefault ("parent" , self )
518
514
result = command (** kwargs )(func )
519
515
self .add_application_command (result )
520
516
return result
You can’t perform that action at this time.
0 commit comments