我正在调查为什么我要得到这个错误与我的Python不和谐的机器人。我在VScode中与Nextcord库一起使用Python。它工作了一点,它们抛出了这个错误:
Ignoring exception in command <nextcord.application_command.SlashApplicationCommand object at 0x000002379C4C7730>:
Traceback (most recent call last):
File "C:\Users\jonat\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\nextcord\application_command.py", line 863, in invoke_callback_with_hooks
await self(interaction, *args, **kwargs)
File "C:\Users\jonat\OneDrive\Documents\DiscordBot\main.py", line 53, in arem
await interaction.response.send_message("||**Cal Jordan:** Instant message from... AREM!!||", files=[nextcord.File('AREM.mp3')])
File "C:\Users\jonat\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\nextcord\interactions.py", line 895, in send_message
await adapter.create_interaction_response(
File "C:\Users\jonat\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\nextcord\webhook\async_.py", line 204, in request
raise NotFound(response, data)
nextcord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction
The above exception was the direct cause of the following exception:
nextcord.errors.ApplicationInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction发布于 2022-10-28 16:42:39
“未知互动”通常意味着你需要很长时间才能做出反应。
不和允许3秒来回应。如果您想扩展它,您可以在函数的开头使用await interaction.response.defer()来显示"bot正在思考“长达15分钟,以便您有时间响应。
有关更多信息,请参见https://docs.nextcord.dev/en/stable/interactions.html#deferred-response。
https://stackoverflow.com/questions/74214588
复制相似问题