Purge messages by time interval #6979
Unanswered
erkinalp
asked this question in
API Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
#208 (comment)
The endpoint design could be quite simple (
POST /channels/:id/purge
in my proposed design). It should have two parameters:before
: the largest message snowflake, inclusive (if omitted, from the time of invocation)after
: the smallest message snowflake, inclusive (if omitted, from the channel create)and yes, defaulting to wholesale blanking of the channel is intentional
Guild members with
MANAGE_MESSAGES
ANDMANAGE_CHANNELS
in the respective channel and guild owners should be able to invoke this operation. No limits on the number of covered messages should be imposed.I've done a test implementation of it in my own reimplementation of Discord API, turns out the code required is actually just about 50 lines if you don't consider table fragmentation in any way whatsoever.
Clients should still receive
MESSAGE_BULK_DELETE
events (yes, events, one for every 100-ish messages) with all affected message IDs, to be able to know which messages they should drop without having to do an expensive lookup.Beta Was this translation helpful? Give feedback.
All reactions