Message editing fails even though message can be fetched

Whenever I want to edit an ephemeral message I get the following error:
[ERROR] Encountered error while handling an interaction handler run method for interaction-handler "release_card" at path "/home/developer/Wishbot/src/interaction-handlers/release_card.js" DiscordAPIError[10008]: Unknown Message
[ERROR] Encountered error while handling an interaction handler run method for interaction-handler "release_card" at path "/home/developer/Wishbot/src/interaction-handlers/release_card.js" DiscordAPIError[10008]: Unknown Message
The message can be correctly fetched though using the channel and message id
let msg = await channel.messages.fetch(interaction.message.id);
console.log(msg); //<= Shows the correct message object
return await msg.edit({embeds: [msg.embeds],components:[]}); //<= breaks because this message is Unknown
let msg = await channel.messages.fetch(interaction.message.id);
console.log(msg); //<= Shows the correct message object
return await msg.edit({embeds: [msg.embeds],components:[]}); //<= breaks because this message is Unknown
2 Replies
Favna
Favna2y ago
ephemeral messages cannot be edited. If you want to edit it after sending it then call interaction.editReply
Himori
HimoriOP2y ago
yeah so I can't do ephemeral or I can't edit it thank you
Want results from more Discord servers?
Add your server