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:
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
Jump to solution
5 Replies
Favna
Favna10mo ago
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:
Spinel
Spinel10mo ago
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
KaydaFox
KaydaFox10mo ago
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
Favna
Favna10mo ago
audit logs dont log if say I remove my own message though, at least afaik 👀
KaydaFox
KaydaFox10mo ago
Yeah they don't, so I default it to the user who sent the message
Want results from more Discord servers?
Add your server