Delete bot Message in a DM Channel !
Hey !
I'd know if it's possible to clear all messages from the bot in a DM channel !
I tried in many way, but nothing succeed !
Does anyone have any leads and more importantly, are these messages really deletable?
Thanks !
5 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.you would have to fetch all the messages in the channel, filter the ones not from your bot out, iterate over them and call .delete() on each of them.
aka not recommended
why do you even need this
I tried with that :
But all console log return undefined...
in fact, no matter which property I try to access, it returns "undefined".
But if I log the whole object, I can see the properties and their values, is it an Intents problem ?
To clear the DMs I have with my bot which is getting messy with all my tests x)
const mess of [...messageToDel.values()]
Owh ! Yeah ! It worked !
I guess I have to review my knoweldge on Maps x)
Thanks ! = )