To reproduce:
- Change the list of commands (perhaps by merging a PR into
main)
- Update the bot
- Try to run the new command from a Desktop client, expecting the bot to reply
- (Occasionally) observe an apparent hang, and an error in the console about
DiscordAPIError[10062]: Unknown interaction
- Reload your client
- Try the command again, should work fine.
Not sure why Discord sends the bot interactions that are "unknown" to it, so some research will be necessary. I suspect there's nothing that our bot can do if the interaction is "unknown," since it cannot reply to the user to say so. Perhaps the bot could avoid trying to reply to "unknown" interactions.
I wonder if the interaction's commandId property has useful information that we should be checking about the command invocation, rather than the name property. Will have to investigate further.
To reproduce:
main)DiscordAPIError[10062]: Unknown interactionNot sure why Discord sends the bot interactions that are "unknown" to it, so some research will be necessary. I suspect there's nothing that our bot can do if the interaction is "unknown," since it cannot reply to the user to say so. Perhaps the bot could avoid trying to reply to "unknown" interactions.
I wonder if the interaction's
commandIdproperty has useful information that we should be checking about the command invocation, rather than thenameproperty. Will have to investigate further.