You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug is a race condition that concerns parent slash command with attached children commands, found while coding my bot. I noticed this bug defining a after_slash_command_invoke where ApplicationCommandInteraction.application_command.name was returning the same name twice (once for the parent command, once for the subcommand)
Reproduction Steps
Create a slash command and attach to it a subcommand
Define & set a after_slash_command_invoke callback
Enjoy the view
Minimal Reproducible Code
First step: Create a slash command and attach to it a subcommand
2022-12-10 17:47:21.890 | INFO | _logging:log_message:43 - :SnipyBot.my_after_slash_command_invoke: - Snipy#7374 - 710570210159099984 | CodeWithVincent - 920882891024629790 | Command search was executed in 0.616953s
2022-12-10 17:47:22.928 | INFO | _logging:log_message:43 - :SnipyBot.my_after_slash_command_invoke: - Snipy#7374 - 710570210159099984 | CodeWithVincent - 920882891024629790 | Command search was executed in 1.654488s
Expected Results
The after_slash_command_invoke is called once (just for the sub_command) or at least the ApplicationCommandInteraction.application_command doesn't get overwrited
Actual Results
after_slash_command_invoke is called twice (once for the parent command and once for it's sub_command) and the ApplicationCommandInteraction.application_command is overwritten
Snipy7374
changed the title
The ApplicationCommandInteraction.slash_command of a parent command is overwrited by children command invokations
ApplicationCommandInteraction.slash_command of a parent command is overwrited by children command invokations
Dec 10, 2022
Snipy7374
changed the title
ApplicationCommandInteraction.slash_command of a parent command is overwrited by children command invokations
ApplicationCommandInteraction.slash_command of parent command is overwrited by children command invokations
Dec 10, 2022
Summary
This bug is a race condition that concerns parent slash command with attached children commands, found while coding my bot. I noticed this bug defining a
after_slash_command_invoke
whereApplicationCommandInteraction.application_command.name
was returning the same name twice (once for the parent command, once for the subcommand)Reproduction Steps
after_slash_command_invoke
callbackMinimal Reproducible Code
First step: Create a slash command and attach to it a subcommand
Second step: Define & set a
after_slash_command_invoke
callbackor subclassing
commands.Bot
demo of the output:
Expected Results
The
after_slash_command_invoke
is called once (just for the sub_command) or at least theApplicationCommandInteraction.application_command
doesn't get overwritedActual Results
after_slash_command_invoke
is called twice (once for the parent command and once for it's sub_command) and theApplicationCommandInteraction.application_command
is overwrittenIntents
disnake.Intents.default()
System Information
Checklist
Additional Context
The text was updated successfully, but these errors were encountered: