edit ephemeral message without access to interaction object

// example code
const message = await channel.messages.getch(messageId)

message.edit({content: `The voice channel linked in this message has since been deleted...`})

// error
<rejected> DiscordAPIError[10008]: Unknown Message
// example code
const message = await channel.messages.getch(messageId)

message.edit({content: `The voice channel linked in this message has since been deleted...`})

// error
<rejected> DiscordAPIError[10008]: Unknown Message
From my understanding ephemeral messages are editable via the interaction's token. So, the Discord api allows for this functionality... But there is currently no method for doing this via djs?
5 Replies
d.js toolkit
d.js toolkit2y ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
monbrey
monbrey2y ago
You can construct an InteractionWebhook to do so
d.js docs
d.js docs2y ago
class InteractionWebhook Represents a webhook for an Interaction
monbrey
monbrey2y ago
This is the webhook used by the interaction object to do the edits normally message.edit attempts to use the regular message API, which will fail as its ephemeral
ninbura
ninburaOP2y ago
🙏

Did you find this page helpful?