#Fetch the user who deleted the message

30 messages · Page 1 of 1 (latest)

idle geode
#

As the title mentioned, I'd like to know if there's a way to do that through onMessageDelete

rough scarabBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
shadow stone
#

Fetch the AuditLog of the deletion. It there is none it was either the author themselves or a bot

idle geode
shadow stone
#

Check the timestamp

idle geode
shadow stone
#

No, the timestamp the AuditLogsEntry was created

quaint kernelBOT
idle geode
#

ok..

#

but here's another problem

#

As you can see

#

if someone delete msg for 2 times or above

#

the method wont work

shadow stone
#

It does. Just because the view for AuditLogs in discord app amalgamates them into one doesn’t mean there actually is one single log entry

idle geode
#

umm

#

1692619302049 stands for the timestamp of the auditlog

#

I deleted two msg

#

but the timestamp are the same

shadow stone
#

And the rest of the AuditLogEntry?

idle geode
#

the rest?

shadow stone
#

The full instance

idle geode
#

umm

#

I fetched the top 2 of them

shadow stone
#

Oh, well, guess you should/could check extra.count and .channel then

idle geode
#

OK got it