Closed Dynamixus closed 1 year ago
No such error would occur if i copy/paste that code. If you want to defer, just use interaction.response.defer()
. Buttons still respond after a interaction has been defered.
I really just used a boiler code, supposing that I do web requests for the descriptions of the embeds that will take at least 3 seconds or more to get the data. At which point, the command will send a The application did not respond
ephemeral message on Discord like so:
And the console will show this traceback:
Traceback (most recent call last):
File "C:\Users\Xer\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 441, in _run_event
await coro(*args, **kwargs)
File "C:\Users\Xer\source\repos\RenGenBreadCloneStable\bot.py", line 350, in on_command_error
raise error
File "C:\Users\Xer\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\ext\commands\hybrid.py", line 438, in _invoke_with_namespace
value = await self._do_call(ctx, ctx.kwargs) # type: ignore
File "C:\Users\Xer\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\app_commands\commands.py", line 846, in _do_call
raise CommandInvokeError(self, e) from e
discord.ext.commands.errors.HybridCommandError: Hybrid command raised an error: Command 'char' raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction
I tried interaction.response.defer()
but it still doesn't work.
~I tried interaction.response.defer()
but it still doesn't work.~
Sorry about that, I just learned that I should defer before I do stuff that takes a long time. Thank you for the time!
Describe the bug
Title.
I keep getting this error:
discord.ext.commands.errors.HybridCommandError: Hybrid command raised an error: Command 'char' raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction
when using the command as a slash command. Command works fine when I use the prefix command.And upon googling I found that it may be because I used web requests frequently in this specific command. A solution I found requires me to defer my response via:
But looking through the documentation I don't see an implementation of the sort of this. Is there a workaround for this?
Minimal Reproducible Code
Traceback
Library Version
Required Checklist
Additional Comments
No response