Deleting messages with button action

hey so i know this is probably a really minor issue but i'm making an interactable embed with button interactions and im almost done but when i press a delete button i made, the embed is gone just as intended, but the bot crashes and gives me this error: Uncaught DiscordAPIError DiscordAPIError[10008]: Unknown Message at handleErrors (c:\Users\Moh\Desktop\clutter\Gacha-Bot\bot-14\Tater\node_modules@discordjs\rest\dist\index.js:640:13) at processTicksAndRejections (internal/process/task_queues:95:5) i suspect i can fix the code here
collector.on('end', async () => {
if (pageEmbed.deleted) {
return;
}

embeds[page].setColor('#808080'); // Set color to gray
await pageEmbed.edit({ embeds: [embeds[page]], components: [] }); // Remove buttons when time is up
}
collector.on('end', async () => {
if (pageEmbed.deleted) {
return;
}

embeds[page].setColor('#808080'); // Set color to gray
await pageEmbed.edit({ embeds: [embeds[page]], components: [] }); // Remove buttons when time is up
}
i wrote
if (pageEmbed.deleted) {
return;
}
if (pageEmbed.deleted) {
return;
}
intending that if its gone it should just return and do nothing, thats where im guessing the error is coming from anyway.
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Xu Xiaolan
Xu XiaolanOP2y ago
ah okay thanks i knew it was a dum issue lol, yep fixed and nicely working now
Want results from more Discord servers?
Add your server