Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.10/site-packages/disnake/ext/commands/interaction_bot_base.py", line 1353, in process_application_commands
await app_command.invoke(interaction)
File "/app/.heroku/python/lib/python3.10/site-packages/disnake/ext/commands/slash_core.py", line 739, in invoke
raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: TimeoutError: timed out``` How do I fix this?
#TimeoutError
1 messages · Page 1 of 1 (latest)
Helps if you show the related code.
But it looks like you have a timeout function somewhere. Maybe for a button, modal or select that is being called.
class Refresh(disnake.ui.View):
def __init__(self):
super().__init__(timeout=None)
self.value = None
@disnake.ui.button(label="Refresh", style=disnake.ButtonStyle.blurple, emoji=':arrows_clockwise:', custom_id='refbutton')
async def confirm(self, button: disnake.ui.Button, inter: disnake.MessageInteraction):
eph = await inter.response.send_message("Refreshing :arrows_clockwise:", ephemeral=True)
self.value = True
server = BedrockServer.lookup('minecraft server ip')
status = server.status()
if status.players_max == 1:
off = #embed here
await inter.message.edit(embed=off)
else:
on = #embed here
await inter.message.edit(embed=on)
@bot.command(hidden=True, description='can check status')
async def d(ctx):
view = Refresh()
off = #embed
off.set_footer(icon_url=ctx.guild.icon, text=ctx.guild.name)
await ctx.send(embed=off, view=view)
@bot.event
async def on_ready():
print('Bot is ready.')
bot.add_view(view=Refresh())```
another error ```console
Ignoring exception in view <Refresh timeout=None children=1> for item <Button style=<ButtonStyle.primary: 1> url=None disabled=False label='Refresh' emoji=<PartialEmoji animated=False name='🔃' id=None> row=None>:
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.10/site-packages/disnake/interactions/base.py", line 945, in send_message
await adapter.create_interaction_response(
File "/app/.heroku/python/lib/python3.10/site-packages/disnake/webhook/async_.py", line 199, in request
raise NotFound(response, data)
disnake.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 "/app/.heroku/python/lib/python3.10/site-packages/disnake/ui/view.py", line 363, in _scheduled_task
await item.callback(interaction)
File "/app/cogs/main.py", line 62, in confirm
eph = await inter.response.send_message("Refreshing 🔃", ephemeral=True)
File "/app/.heroku/python/lib/python3.10/site-packages/disnake/interactions/base.py", line 955, in send_message
raise InteractionTimedOut(self._parent) from e
disnake.errors.InteractionTimedOut: Interaction took more than 3 seconds to be responded to. Please defer it using "interaction.response.defer" on the start of your command. Later you may send a response by editing the deferred message using "interaction.edit_original_response"
2022-11-06T14:18:33.744218+00:00 app[worker.1]: Note: This might also be caused by a misconfiguration in the components make sure you do not respond twice in case this is a component.```
why it suddenly stops working, everything was fine 1 month ago, the bot as not used in last 1 month and I didn't made any change in code
nvm, this error was for an alternative command which does the same work (it's a slash command, and the content which button had was the same)
because BedrockServer.lookup is likely taking more than 3 seconds to respond.
yeah, it's an issue with that library. it's throwing an error after 5 seconds
So you need to defer to extend that initial 3 seconds response time to up to 15 minutes
Actually that won't solve the issue, because it's problem with the library or the actual api
I've reported it to them
Thanks for you response