Handle interaction after restart

Hello, I am making a restart command. It sends a message saying it is restarting. When it has restarted, I want it to edit the message to say it has restarted. I was thinking of doing something along the lines of this:
const i = await interaction.sendEmbed({
title: "Restarting...",
description: "The bot is restarting...",
components: [actionRow],
});

if (i) {
Deno.env.set("RESTART", i.id);
}

Deno.exit();
const i = await interaction.sendEmbed({
title: "Restarting...",
description: "The bot is restarting...",
components: [actionRow],
});

if (i) {
Deno.env.set("RESTART", i.id);
}

Deno.exit();
And then I would have to fetch the interaction on client.ready. Is there any way to do so? Thanks!
6 Replies
d.js toolkit
d.js toolkit3mo 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! - Marked as resolved by staff
Tijme
TijmeOP3mo ago
fyi interaction.sendEmbed is a custom method I created, it just sends an embed with some default values and returns the InteractionResponse
treble/luna
treble/luna3mo ago
you cannot fetch interaction responses, only messages
Tijme
TijmeOP3mo ago
It's a user app, so that'll probably not work
treble/luna
treble/luna3mo ago
to do that, you need to pass in withResponse: true when replying then this also isnt gonna work, you would need to store the token of the interaction, then create a webhook client to edi tit
Tijme
TijmeOP3mo ago
that sounds like too much work lmao thanks for the info tho!

Did you find this page helpful?