-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed as not planned
Labels
off-topicThis does not belong here.This does not belong here.
Description
Summary
Random 404 errors pop up, I'm pretty sure sending a modal shouldn't take more than 5 seconds though.
Reproduction Steps
I ran the command /reupload with this code.
Minimal Reproducible Code
intents = discord.Intents.default()
intents.typing = False
intents.presences = False
intents.reactions = True
intents.members = True
intents.guilds = True
bot = commands.Bot(command_prefix="/", intents=intents)
@bot.event
async def on_ready():
await bot.change_presence(activity=discord.Game(name="https://tiktools.fr/"))
print(f"Bot is ready. Logged in as {bot.user.name}")
synced = await bot.tree.sync()
print(f"synced {len(synced)} command(s)")
@bot.tree.command(name="reupload", description="Génère une vidéo TikTok à partir d'un extrait de vidéo YouTube")
async def reupload(interaction: discord.Interaction):
if interaction.user.id in active:
await interaction.followup.send("Merci d'attendre la fin de l'opération précédente avant d'en démarrer une nouvelle !", ephemeral=True)
return
await interaction.response.send_modal(ReuploadModal())
bot.run([Token])
Where ReuploadModal is obviously defined as some modal.
Expected Results
I expected a modal to open for me to enter what I need the bot to do.
Actual Results
The modal opened, but I get this error :
2023-07-23 01:08:43 ERROR discord.app_commands.tree Ignoring exception in command 'reupload'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/commands.py", line 828, in _do_call
return await self._callback(interaction, **params) # type: ignore
File "/root/test.py", line 737, in reupload
await interaction.response.send_modal(ReuploadModal())
File "/usr/local/lib/python3.9/dist-packages/discord/interactions.py", line 972, in send_modal
await adapter.create_interaction_response(
File "/usr/local/lib/python3.9/dist-packages/discord/webhook/async_.py", line 219, in request
raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/tree.py", line 1248, in _call
await command._invoke_with_namespace(interaction, namespace)
File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/commands.py", line 853, in _invoke_with_namespace
return await self._do_call(interaction, transformed_values)
File "/usr/local/lib/python3.9/dist-packages/discord/app_commands/commands.py", line 846, in _do_call
raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'reupload' raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction
It may seem as not that big of a deal, but it can completely break other parts of my code where I need to retrieve infos related to the response object.
Intents
See the code.
System Information
- Python v3.9.2-final
- discord.py v2.3.1-final
- aiohttp v3.8.4
- system info: Linux 5.10.0-23-amd64 Fix issue with author changing type #1 SMP Debian 5.10.179-1 (2023-05-12)
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
- I have removed my token from display, if visible.
Additional Context
Another weird thing is the randomness of this error. Sometimes it pops up 3 times in a row, sometimes it just never does.
Metadata
Metadata
Assignees
Labels
off-topicThis does not belong here.This does not belong here.