Dump and load cached messages.
I'm not the one that usually works with the Discord Bot in our system, but I usually learn somethings.
I know the Client keeps a cache of messages and such, ultimately I want to be able to get who deleted a message and why, is there a way to access the cache of messages directly, since Partials don't let me see anything from the onDeletedMessage.
Solution:Jump to solution
if you only want to get who deleted a message, the way i do it in bots i have for some servers is by fetching audit logs and comparing the author and stuff
5 Replies
Not really honestly. Only for a very short time after deletion. You can look at @Skyra 's snipe command for basically the limit that is possible.
In lieu of me being too lazy to grab the URL manually:
Discord Bots using @sapphire/framework
v5.x
- Gemboard ᴱ ᴰ
- Skyra ᴱ ᴬ ᴰ
- Dragonite ᴱ ᴰ
- Archangel ᴱ ᴰ
- Official Bot Examples ᴱ ᴰ ᴶˢ
- KBot ᴱ ᴬ ᴰ
v4.x
- Radon ᴱ ᴬ
- Sapphire Application Commands Examples ᴱ
- Zeyr ᴰ ᴬ
- Birthdayy ᴰ
- RTByte ᴱ ᴬ
Legend for the identifiers
ᴱ: Uses ESM (if not specified then uses CJS)
ᴬ: Advanced bot (if not specified it is a simple bot, or not graded)
ᴰ: Uses Docker in production
ᴶˢ: Written in JavaScript. If not specified then the bot is written in TypeScript.
Solution
if you only want to get who deleted a message, the way i do it in bots i have for some servers is by fetching audit logs and comparing the author and stuff
audit logs dont log if say I remove my own message though, at least afaik 👀
Yeah they don't, so I default it to the user who sent the message