MODiX
MODiX copied to clipboard
Gracefully handle !clean requests for old messages
Discord's bulk message delete API won't delete messages older than 2 weeks and will throw an error if you try. It might be nice to limit the messages we try to delete with !clean
to messages within the past 2 weeks so that we don't end up bumping into that error.
what if we fall back to the non-bulk api if older than 2 weeks, and just slowly churn through the messages until done?
Discord doesn't like that, AFAIK. The best option IMHO would be to filter the message IDs based on whether their snowflake is greater than or equal to this:
var minimum = SnowflakeUtils.ToSnowflake(DateTimeOffset.UtcNow.Subtract(TimeSpan.FromDays(14)));
Discord doesn't like deleting old messages?
I'm guessing this is in reference to deleting an archive channel?
@JakenVeina This is in reference to deleting messages from any channel where the message is older than two weeks.
The restriction was put there in the first place because it was slowing down their database queries - I imagine deleting a single message does the same thing, but much slower.
As part of a new effort to refocus on priorities, I will close this. If you feel this is imperative to the bot, a new issue can be opened to supersede this.