bulkDelete doesn't delete messages 2 weeks old?
Is this true? Does bulkDelete not delete messages two weeks old? If this is the case, and I want to delete a batch of specific messages that are older than 2 weeks old, is the best way to fetch each message and execute a delete on them individually?
20 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.Yes it is true
so running singular deletes is probably the better solution, especially if I'm deleting specific messages with specific ids
And i think thats the best way of doing it if you really want to delete it
Dont know if it would work tho
Youll have to try it out
You shouldnt delete too many messages at once that way
for just a few its fine but more than that not so much
what's the best way, for say I have 50 messages that need to be deleted (they're specified by ids)
if all of those are older than 2 weeks i would find some other way than to delete them
I'm doing something like this atm:
minus the console logs obviously lol
thats going to get ratelimited quite easily
generally not a good idea
iirc the ratelimits for deleting messages is 5/1s per channel
So you could use setInterval
I was thinking of that
implementing some type of exponential backoff
i wouldnt recommend that. Like i said youd be better off finding an alternative to deleting too many messages older than 2 weeks
does updating and creating messages also have the same rate limitations?
the ratelimits for those is less
I only ask because there might be situations where I'm batch creating messages and/or updating
yeah you should avoid that too
generally you shouldnt be doing anything in large clusters
basically I have it set up where an application is filled and sent to my web site, I create an entry in the db and I also create a copy to be posted onto discord
ahh, okay
its fine if it happens by user input and doesnt occur too often
sending up to 5 messages at once is still fine
there are different ratelimits for this stuff
so my approach to it is just to avoid doing anything in clusters like i said
I looked for the documentation on the different rate limits, but maybe I'm blind, can't seem to find it other than the global rate limit is 50 per second
its a bit of a mystery