If you are going to use ephemeral=True, you need to use it on defer and on response
The message not found means the message you are trying modify has been deleted/does not exist, which is odd, since you are not replying/modifying.
Also, did you change the code? The tracebacks are no longer accurate, could you post them again?
The embeds work perfectly when I don’t have await ctx.channel.purge(limit=amount, check=not_pinned). However, when I do have it, the purging works — it purges the correct amount of messages — but it only displays the embed for 0, negative purges, and 1. Otherwise, it gives the following error:
Ignoring exception in command purge:
Traceback (most recent call last):
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/core.py", line 124, in wrapped
ret = await coro(arg)
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "main.py", line 137, in purge
await ctx.defer(ephemeral=True)
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/interactions.py", line 655, in defer
await self._locked_response(
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/interactions.py", line 1090, in _locked_response
await coro
File "/home/runner/Presto/venv/lib/python3.10/site-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 "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/core.py", line 375, in invoke
await injected(ctx)
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction
This is how to properly use ctx.defer yes, I thought I already said that up there somewhere but ig not. Probably should have specified that defer is a one-time thing and should be never called twice.
I decided to test it just now, but it didn’t work. It gave me the an Unknown Message error. I copied and pasted the code you had. Here’s the error:
Ignoring exception in command purge:
Traceback (most recent call last):
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/core.py", line 124, in wrapped
ret = await coro(arg)
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/core.py", line 982, in _invoke
await self.callback(ctx, **kwargs)
File "main.py", line 138, in purge
await ctx.respond(embed=purgeEmbed, ephemeral=True)
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/context.py", line 286, in respond
return await self.followup.send(*args, **kwargs) # self.send_followup
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/webhook/async_.py", line 1745, in send
data = await adapter.execute_webhook(
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/webhook/async_.py", line 219, in request
raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/bot.py", line 1114, in invoke_application_command
await ctx.command.invoke(ctx)
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/core.py", line 375, in invoke
await injected(ctx)
File "/home/runner/Presto/venv/lib/python3.10/site-packages/discord/commands/core.py", line 132, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: NotFound: 404 Not Found (error code: 10008): Unknown Message
I have to go now, so I may check tomorrow, or on the weekend, or right now, so please respond ASAP.