Skip to content

Messages older than 2 weeks can't be purged with /purge #49

@ktwrd

Description

@ktwrd

When purging messages older than 2 weeks, the following exception would be thrown:

System.ArgumentOutOfRangeException: Messages must be younger than two weeks old. (Parameter 'MessageIds')
at Discord.Preconditions.YoungerThanTwoWeeks(UInt64[] collection, String name)
at Discord.API.DiscordRestApiClient.DeleteMessagesAsync(UInt64 channelId, DeleteMessagesParams args, RequestOptions options)
at Discord.Rest.ChannelHelper.DeleteMessagesAsync(ITextChannel channel, BaseDiscordClient client, IEnumerable`1 messageIds, RequestOptions options)
at XeniaBot.Core.Modules.ModerationModule.PurgeMessages(Int32 count, IChannel channel) in /src/XeniaBot.Core/Modules/ModerationModule.cs:line 335

await targetChannel.DeleteMessagesAsync(messageList);

This should be fixed so mods can use the /purge command. But this needs to be done once BanSync PostgreSQL data migration has been deployed & ran.

https://docs.discord.com/developers/resources/message#bulk-delete-messages

Might need to implement a queue for this operation in a channel, since only 5 messages per second can be deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions