SamuelCurrid/Gompei-Bot

[Feature Request] Purge by Message ID

Closed this issue · 0 comments

Feature: Purge by Message ID

Parameters:

  • Channel
    • Direct channel link
    • channel ID
  • Start message
    • Message link
    • Message ID
  • (optional) End message
    • Message link
    • Message ID

Behavior:

  • When given a channel and only a start message, purge all messages posted in the provided channel after and including the start message
  • When given a channel, a start message, and an end message, purge all messages posted in the provided channel after and including the start message AND before and including the end message

Example calls:

  • .mpurge #general 642051421549625395 -> purges all messages posted in #general after and including the message with ID 642051421549625395
  • .mpurge #general-2 642051421549625395 -> produce an error because there is no message with the provided ID in the provided channel
  • .mpurge 567169726250352644-642051421549625395 -> purges all messages posted in channel with ID 567169726250352644 after and including the message with ID 642051421549625395(this is the format that discord gives when you shift+click to get a message ID)
  • .mpurge https://ptb.discord.com/channels/567169726250352640/567169726250352644/642051421549625395 -> purges all messages posted after the linked message (inclusive)
  • .mpurge https://ptb.discord.com/channels/567169726250352640/567169726250352644/642051421549625395 https://ptb.discord.com/channels/567169726250352640/567169726250352644/642070277655756801 -> purges all messages posted after the first linked message and before the second linked message (inclusive)
  • .mpurge https://ptb.discord.com/channels/567169726250352640/567169726250352644/642051421549625395 https://ptb.discord.com/channels/567169726250352640/567182715171110942/743314778134413343 -> produce an error because the start and end messages are not in the same channel

Other notes:

  • Channel can be omitted if using message links
  • Secondary confirmation should be required before doing the purge. This could be formatted something like the following:
You are about to purge <#> messages from <channel>. 
The purge will start at <first purged message link> and end at <last purged message link>. 

Are you sure you want to proceed?