grinder icon indicating copy to clipboard operation
grinder copied to clipboard

Retrospective ban by the message text factor

Open ForNeVeR opened this issue 6 years ago • 1 comments

Consider this scenario (sadly, very typical these days):

  1. Spambot1 joins chat1
  2. Spambot2 joins chat2
  3. Spambot3 joins chat3
  4. All three bots send the same message text to the respective chats

Currently, I need to manually visit all the chats and invoke @dotnet_vahter_bot ban separately (because the bots are different users).

What I want is Grinder to automatically ban the Spambot2 and Spambot3 after I shown it the message text of Spambot1.

How to achieve that:

  1. Whenever Grinder starts, it should read last N (N should be configurable limit, with a sensible default of, say, 25) messages in each of the connected chats, and store these messages in memory.
  2. When a message arrives in any of the connected chats, Grinder should drop the earliest message saved and save a new one (FIFO order).
  3. When a ban request arrives as a reply on the spam message, Grinder should compare that spam message with the saved messages from each of the connected chats. If it finds any match, it should delete the matched message and ban the corresponding users in each of the chats the message was posted.
  4. The spam message should be saved to a separate global in-memory storage with another configurable limit of M (e.g. up to 10 messages, we don't need much here because of their variety).
  5. When a new message is registered in any of the connected chats, Grinder should compare it with the M globally stored spam messages, and ban the user/delete the message on match.

ForNeVeR avatar May 18 '19 16:05 ForNeVeR

Should work for the following types of content:

  • for text messages
  • for media messages (images)
  • for stickers

Should ignore too short text messages (e.g. messages smaler that some configurable limit, e.g. 25 characters) in case they contain no media/stickers to avoid mass ban for messages like "hello" or something like that.

ForNeVeR avatar Dec 27 '19 10:12 ForNeVeR