group-butler / GroupButler

This bot can help you in managing your group with rules, anti-flood, description, custom triggers, and much more!
https://t.me/GroupButler_bot
GNU General Public License v2.0
443 stars 295 forks source link

Warning sent twice #129

Open RememberTheAir opened 7 years ago

RememberTheAir commented 7 years ago

1 - Sending a photo with a telegram.me link in the caption or forwarding a photo from a channel result in a double warn, if telegram.me links or messages from channels (antispam) and photos (media) are both forbidden in the chat.


2 - Also, if a message is forwarded from a channel and has a telegram.me link in the caption, msg.spam will contain "links" string. Could be a possible issue if in a group only forwards from channels are forbidden: a message like that will trigger only the telegram.me links block

RememberTheAir commented 7 years ago

Problem n° 2 - msg.spam should be an array of strings

RememberTheAir commented 7 years ago

The problem is that the spam check is made before on_msg_receive is called, in bot.lua I don't want to query redis before that funtion, but it seems to be the only way to fix this, yes