Question
Pycord Unknown interaction
I'm trying to make a embed message with buttons. For support system but I'm getting Unknown interaction error. I added ephemeral=True
to defer.
Also changed this:
interaction.response.send_message
to this interaction.followup.send()
embed = discord.Embed(
title="Are You Looking For Help?",
description="Use buttons man.",
color=discord.Colour.blurple(),
)
class MyView(discord.ui.View):
@discord.ui.button(label="Open Ticket", style=discord.ButtonStyle.primary, emoji="😎")
async def button_callback(self, interaction: discord.Interaction, _):
await interaction.followup.send("You clicked the button!")
@bot.slash_command(name="support")
async def support(ctx):
await ctx.defer(ephemeral=True)
view = MyView()
await ctx.response.send_message(embed=embed, view=view)
bot.run("token")
Error:
C:\Users\playe\PycharmProjects\pythonProject\.venv\Scripts\python.exe "C:\Users\playe\PycharmProjects\Minecraft Player Bot\main.py"
Lolo RS's Main#6223
Ignoring exception in command support:
Traceback (most recent call last):
File "C:\Users\playe\PycharmProjects\pythonProject\.venv\Lib\site-packages\discord\commands\core.py", line 131, in wrapped
ret = await coro(arg)
^^^^^^^^^^^^^^^
File "C:\Users\playe\PycharmProjects\pythonProject\.venv\Lib\site-packages\discord\commands\core.py", line 1013, in _invoke
await self.callback(ctx, **kwargs)
File "C:\Users\playe\PycharmProjects\Minecraft Player Bot\main.py", line 35, in support
await ctx.defer(ephemeral=True)
File "C:\Users\playe\PycharmProjects\pythonProject\.venv\Lib\site-packages\discord\interactions.py", line 748, in defer
await self._locked_response(
File "C:\Users\playe\PycharmProjects\pythonProject\.venv\Lib\site-packages\discord\interactions.py", line 1243, in _locked_response
await coro
File "C:\Users\playe\PycharmProjects\pythonProject\.venv\Lib\site-packages\discord\webhook\async_.py", line 220, 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 "C:\Users\playe\PycharmProjects\pythonProject\.venv\Lib\site-packages\discord\bot.py", line 1130, in invoke_application_command
await ctx.command.invoke(ctx)
File "C:\Users\playe\PycharmProjects\pythonProject\.venv\Lib\site-packages\discord\commands\core.py", line 376, in invoke
await injected(ctx)
File "C:\Users\playe\PycharmProjects\pythonProject\.venv\Lib\site-packages\discord\commands\core.py", line 139, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interactio
n