Closed grayodesa closed 9 months ago
I observed same thing. Here is log:
timestamp | message |
---|---|
2023/12/13 15:42:58.736 | user Tati 🇨🇻 detected as spammer: {name: stopword, spam: false, details: not found}, {name: emoji, spam: true, details: 7/2}, {name: similarity, spam: false, details: 0.03/0.50}, {name: classifier, spam: false, details: probability: 100.00%, certain: true}, {name: cas, spam: false, details: Record not found.}, "🔥🪗 21 снежня адбудзецца канцэрт аднаго з самых гіпнатычных і магічных акардэаністаў Еўропы - беларуса Ягора Забелава🪗🔥\n\nНекалькі год таму ён ужо збіраў поўную залю ў г. Гаага і зараз будзе рады пабачыць усіх на канцэрце ў Den Bosch! \n🍻 Пасля будзе нагода сустрэцца з музыкантам і беларусамі ў кафэ, паразмаўляць, падняць чарку за Каляды і Новы Год. \nКолькасць квіткоў абмежаваная, не прапусціце! \n🎟️ Замовіць квіткі: https://www.willem-twee.nl/alle-activiteiten/yegor-zabelov-743950\n\n📍21.12.2023, 20:15 Prins Bernhardstraat 4, Den Bosch" |
2023/12/13 15:42:58.736 | spam detected from {1171070045 TatiVanD Tati 🇨🇻}, response: Забаніў спамера: "Tati 🇨🇻" (1171070045) |
2023/12/13 15:42:58.779 | {1171070045 TatiVanD Tati 🇨🇻} banned by bot for 9600h0m0s |
2023/12/13 15:59:20.201 | unban user 1171070045 |
2023/12/14 07:46:56.148 | user Tati 🇨🇻 detected as spammer: {name: stopword, spam: false, details: not found}, {name: emoji, spam: true, details: 7/2}, {name: similarity, spam: false, details: 0.03/0.50}, {name: classifier, spam: false, details: probability: 100.00%, certain: true}, {name: cas, spam: false, details: Record not found.}, "🔥🪗 21 снежня адбудзецца канцэрт аднаго з самых гіпнатычных і магічных акардэаністаў Еўропы - беларуса Ягора Забелава🪗🔥\n\nНекалькі год таму ён ужо збіраў поўную залю ў г. Гаага і зараз будзе рады пабачыць усіх на канцэрце ў Den Bosch! \n🍻 Пасля будзе нагода сустрэцца з музыкантам і беларусамі ў кафэ, паразмаўляць, падняць чарку за Каляды і Новы Год. \nКолькасць квіткоў абмежаваная, не прапусціце! \n🎟️ Замовіць квіткі: https://www.willem-twee.nl/alle-activiteiten/yegor-zabelov-743950\n\n📍21.12.2023, 20:15 Prins Bernhardstraat 4, Den Bosch" |
2023/12/14 07:46:56.149 | spam detected from {1171070045 TatiVanD Tati 🇨🇻}, response: Забаніў спамера: "Tati 🇨🇻" (1171070045) |
2023/12/14 07:46:56.175 | {1171070045 TatiVanD Tati 🇨🇻} banned by bot for 9600h0m0s |
Well, this is expected. We don't want to exclude other bots as they may send spam. Your solution is acceptable; adding supers prohibits the bot from kicking them out. Maybe superuser is a little bit too much, but adding another list of "preapproved" users makes this thing more complicated for no good reason. The fact it is listed in superusers doesn't give those users any other super-powers unless you explicitly invite them to the admin chat.
I don't know, whether it is possible for a bot to get a list of admins of current chat, but if it is possible, maybe it makes sense to retrieve such a list and treat all admins of the chat as supers?
there is a method to get the list of admins, well, kind of. It worked in my test, but according to docs, bot's permission and admins' privacy settings can limit it. Anyway, added this thing to master, give it a try.
It will report detected admins in the log, like this: add admins to superusers: {test_usert, umputun}
in our chat it got all admins, except one. That should be due to the privacy settings, i guess
{tgspam_umputun_bot, alek_sys,grayodesa, bobuk, umputun}
feel free to update master image, should address the issue
this was released as a part of v1.1.0, closing
The bot recognized as a spam a message from another bot — it was basically the message from the channel posted by Telegram itself to a group linked to the channel. After unban and posting the same message again, the bot again detected a spam. I have added Telegram (ID: 777000) as a superuser to let the bot to ignore its messages.
Logs are below.