bot icon indicating copy to clipboard operation
bot copied to clipboard

Send message contents in DMs for messages deleted by auto mod

Open Numerlor opened this issue 5 years ago • 6 comments

When an automatic deletion happens for example with a token or an attachment, the user's message is currently lost. Assuming the DMs are open, in cases like the 2 above where the deletion was not for something like spam, sending the deleted contents would make it a bit more friendly towards the user

Numerlor avatar Jun 12 '20 23:06 Numerlor

I'm not sure if users would find DMs annoying. I'm OK with this idea. Perhaps the informational message ("you're message has been deleted cause xyz") could also be moved to DMs to reduce clutter (assuming they have DMs enabled).

MarkKoz avatar Jun 16 '20 00:06 MarkKoz

I quite like the idea. Like Mark said as well, having it only sends DMs of possible would be a nice addition. The only real issue I can see with that is the user not realising that the message was deleted and sending it again. Maybe we could reduce the server message to something simple that mentions the main cause of the deletion and asks the user to check their DMs for more info. If they don’t have DMs enabled, it would simply be like today.

gustavwilliam avatar Oct 19 '20 00:10 gustavwilliam

Which filters would we want to include here? Looking through it the token and webhooks removers, and antimalware are the ones that will benefit the most, but the everyone ping filter and invite filters also feel like they could be triggered accidentally without knowledge of the removals from the bot.

The current process I was thinking of is to delete the user message then check if the user has open DMs:

  • If they are open, send the current in channel notification and their original message through the DMs

  • If they aren't open, send the current notif message in the channel with something like To retrieve your deleted message open DMs and run the !foo command added to the end. Then keep the message around through redis, until the user requests it or some cleanup of stale messages is done.

With the current filtering layout it doesn't look like there'd be a very nice way of doing this so I'll look into a rewrite if it's viable and the feature would benefit from it

Numerlor avatar Nov 04 '20 02:11 Numerlor

Let's consider adding a word or character count threshold. Really short messages aren't worth relaying. This may alleviate concerns of DMs being annoying.

webhooks removers, and antimalware are the ones that will benefit the most

I agree, though in the case of antimalware, attachments without any message written should be ignored.

everyone ping filter and invite filters

Maybe for the ping but I don't think it's necessary for invites.

Then keep the message around through redis, until the user requests it or some cleanup of stale messages is done.

I don't agree with this. It should be simpler: if they have DMs enabled, send them their message. If not, too bad. Writing a command and caching messages seems overcomplicated for the amount of use I foresee the feature receiving.

I'll look into a rewrite if it's viable

Some of the filtering code is quite old and would benefit from a rewrite regardless of this feature, so you're welcome to tackle that if you wish.

MarkKoz avatar Nov 16 '20 18:11 MarkKoz

Then keep the message around through redis, until the user requests it or some cleanup of stale messages is done.

I don't agree with this. It should be simpler: if they have DMs enabled, send them their message. If not, too bad. Writing a command and caching messages seems overcomplicated for the amount of use I foresee the feature receiving.

The implementation for that shouldn't have much complexity, just setting/getting and some background to delete the stale data, and could possibly save some headache for some users; would like to hear some other opinions on this. Although I'm not sure if there are any considerations wrt the privacy policy, maybe @jb3 could shine some light on that.

I'll slowly start working on this.

Numerlor avatar Jan 12 '21 03:01 Numerlor

Superseded by #1530

Akarys42 avatar Apr 17 '21 14:04 Akarys42

It wasn't impleneted as part of #1530 but it now very easy to do so by adding another formatting option to https://github.com/python-discord/bot/blob/c36a5df84f8f017a90d465928566fc8885ea7bcc/bot/exts/filtering/_settings_types/actions/infraction_and_notification.py#L173-L176

mbaruh avatar Jul 22 '25 20:07 mbaruh