umputun / tg-spam

Anti-Spam bot for Telegram

Home Page:https://tg-spam.umputun.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow forwards without bans

asm0dey opened this issue · comments

We have an admin group for our main group, and sometimes we just forward messages from one to another to discuss something. I would really like users of the forwarded messages to not be banned, instead, I would prefer to mark messages as spam/ham manually.

It appears that you use the common group where all the admins communicate for spam messages as well. This is not the intended use - spam messages should have a separate group, eliminating the issues you've described.

The suggested change to manually mark messages as spam/ham is overly complicated for the convenience of having a common group, and its implementation is unclear. It would require adding a button for manual banning to each forwarded message, which is problematic. Messages that admins forward to each other would also have this button, as the bot cannot distinguish between a simple forward and one intended for banning.

An alternative solution to address your concern might be to optionally disable the "forwarded ban" feature. However, this approach is flawed, as it would prevent admins from marking messages as spam, thereby completely disabling the bot's learning capability.

I get the idea, but why would I want to have two admin groups?

OTOH, probably alternative solution is to introduce a bot command "ban", and allow to disable the forwarding feature altogether.
This way I will just say "/ban@asm0dey_killer_bot" in reply to the spam message, bot will add the message to the spam list, and that's pretty much all.

I made it this way because I want to have two admin groups and avoid polluting the chat/group admins use for regular communication with hundreds of spam reports. This will be fine for the small group with a couple of detected spam messages, but in our case, with 6000+ participants group, we may get tens of spam reports a day. Sending all those to the regular admin group will make it unusable for everyday communication.

Regarding your suggestion, this will work if combined with a new flag, "disable forwarded spam". Feel free to submit a PR with this functionality. As long as this doesn't break the current flow but just adds support of /ban command in the admin group - I will be okay with the change.

@umputun I think it can actually be a ban command in the main chat by any of admins, WDYT?

Yeah, this will do. Probably not too hard to implement as it will follow the same logic as the current admin.MsgHandler does. This can be just a reply from the admin to spam messages with "spam" or "/spam", One more thing that should be handled here, in addition to the ban itself, will be the removal of those replies from the chat as well by the bot

The change in master, you can try it by using :master image

It includes two things:

  • the new option --disable-admin-spam-forward env:DISABLE_ADMIN_SPAM_FORWARD you likely need to set
  • the ability to reply to any message in the primary chat with /spam or spam text triggering the same chain of events as forwarding did (remove spam messages, remove a user from the list of approved, ban user, add spam text to samples, report to admin group). In addition, it will also remove the admin's reply

Give it a try, please, and see how this works.

Wow, it was fast! I only started understanding the language :)

Deployed, let's wait for spam now

Deployed, let's wait for spam now

heh, gimme your group and I'll spam you, have a dedicated account for such type of tests

Released in v1.8.0