zekroTJA / shinpuru

シンプル - Discord Bot with role selection, moderation, karma ranking, a starboard, code execution, raid alerting, backups, a web interface, twitch notifications and more!
https://shnp.de
MIT License
187 stars 36 forks source link

Reaction pruning #249

Closed voxain closed 3 years ago

voxain commented 3 years ago

Type of Feature Request

Description

Sometimes it is really hard to delete an exact amount of messages without deleting too many of them while pruning, since it's often a large amount of messages and it's hard to guess how many there actually are.

I thought, what if you could configure an emoji, when being used as a reaction to a message, it first of course prompts the user, and then starts pruning everything up to that message? Now, I have no idea how that can be done effectively and with a smart UX, but I think it's a nice idea so I wanted to suggest it.

Images and Sketches

zekroTJA commented 3 years ago

What do you think about this implementation?

There are two modes:

  1. Delete single selected messages with the ❌ emote.

https://user-images.githubusercontent.com/16734205/126893039-d23dbe44-8bdd-4ab0-b03e-793168fbf620.mov

  1. Delete all messages sent after (and including) the message selected with the 🔻 emote.

https://user-images.githubusercontent.com/16734205/126893059-7e54c886-9c95-4d13-ab2d-3b458614d723.mov

This is the error message shown when clear selected is executed without any selection. image

Because of API limitations, only the latest 100 messages are scanned for reactions. Also, only reactions set by the executing user are respected.

Edit: And yes, I actually just noticed that the result message is buggy. xD