Together-Java / TJ-Bot

TJ-Bot is a Discord Bot used on the Together Java server. It is maintained by the community, anyone can contribute.
https://togetherjava.org
GNU General Public License v3.0
100 stars 83 forks source link

/quarantine command should also give option to remove message history #1064

Open ankitsmt211 opened 4 months ago

ankitsmt211 commented 4 months ago

Is your feature request related to a problem? Please describe.

Currently if you quarantine a spam bot or an individual with compromised account, it does not purges those scam links. You have to delete em by visiting each channel one at a time, you might even miss some of those.

Describe the solution you'd like

/ban takes an option whether you wanna clear users message history, something like that could also be plugged into /quarantine

Additional context

Ban Command

Quarantine command

Zabuzard commented 4 months ago

Removing message history is difficult without running into rate limits.

Its doable, but similar to Cake Day, requires to spread out all operations over some time.

The problems start with not being able to retrieve a message history of a user in the first place. Only per-channel. (Although, the use case this feature is needed for doesnt require a full and proper message history, its enough to peek the last 10 messages in all channels). And then individual deletion of all these messages, as I dont think they can be bulk-deleted if from different channels.

Requires some API investigation, but probably not that simple.

An alternative approach could be to have the command ban and then unban the user (as the ban command has discord built-in history deletion support), while explaining what happened to the user in DM and that they can join back.

ankitsmt211 commented 4 months ago

I wasn't aware /ban was inbuilt feature from discord, in that case #982 might be able to handle this in future.