messageDelete does not work with old messages.
If I delete a message that I just sent or that I sent a few minutes/hours ago, the bot detects and sends the embed but if I delete an old one, it doesn't work..
12 Replies
- 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!If I delete a message that I just sent or that I sent a few minutes/hours ago, the bot detects and sends the embed but if I delete an old one, it doesn't work..
messageDelete.js :
Ex : A messaexample: a message dated March 5.
it doesn't work with uncached messages, you'd have to enable the partial if you still want to receive a message with just its id
How to make this ?
Thank you but i have an error too.
Something went wrong when fetching the message: DiscordAPIError[10008]: Unknown Message
at handleErrors (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules@discordjs\rest\dist\index.js:1120:23)
at async SequentialHandler.queueRequest (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules@discordjs\rest\dist\index.js:953:14)
at async _REST.request (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules@discordjs\rest\dist\index.js:1266:22)
at async GuildMessageManager._fetchSingle (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\discord.js\src\managers\MessageManager.js:107:18) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Unknown Message', code: 10008 },
code: 10008,
status: 404,
method: 'GET',
url: 'https://discord.com/api/v10/channels/1190031214942376067/messages/1209197420735496253'
}
you can't fetch a deleted message
Yes but what is the utility of partials ?
it will send you the event even if the item isn't cached
Okay, but it is not possible to retrieve one of the following elements: Author of the message, content, reaction.
?
Author maybe perhaps, if the message was deleted by someone other the the message author (by getting it from audit log) and that's a big if, but other things, no
Thank you. ^^