messageUpdate with Partials
I am working on a auditlog feature for my bot, but I ran into a problem when i was working on the messageUpdate handler. I am using message partials so i can see uncatched messages update. But when i try t ofetch oldMessage i get the same content as newMessage. This probably has some stupid easy fix that i just don't understand (i hope).
10 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!You can't fetch old data
It simply doesn't exist anymore
so how do i get the original message
discord.js gives you what it had in the cache. Discord doesn't give you old data
ik but i am using partials so the old content is not there
It's not there because there was no message in the cache. With the partial you tell to discord.hs that you're ready for the structure that has only the id in it. I recommend you read the guide for partial structures
i have
but it dosent say anything about edited messages
There's a warning at the end of the guide that says you cannot fetch as it is already inaccessible by the time you receive the event
The message is already updated. You cannot fetch old data
hmmm