• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / tg-spam / 36024115588
84%

Build:
DEFAULT BRANCH: master
Ran 24 Sep 2026 04:04PM UTC
Jobs 1
Files 44
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Sep 2026 03:58PM UTC coverage: 84.691% (+0.009%) from 84.682%
36024115588

push

github

web-flow
fix(events): treat anonymous group admin /spam, /ban, /warn as super commands (#455)

* fix(events): treat anonymous group admin /spam, /ban, /warn as super commands

Adjacent to #383 (linked-channel admin gate): when a group admin posts
"as the chat" using Telegram's Send-as-chat toggle, the reply arrives
with `From = GroupAnonymousBot` (fake user, id 1087968824) and
`SenderChat.ID == Chat.ID`. Neither branch of the existing fromSuper
check catches it (SuperUsers lookup on the pseudo-user is false,
isLinkedChannel points at a different chat), so the command falls
through to procEvents where the "skip spam check for anonymous admin
post" branch swallows it silently. Symptom: /spam from the anonymous
admin produces zero action, only DEBUG log at listener.go:412.

The Bot API guarantees this shape is admin-only. From the docs:
- sender_chat: "the supergroup itself for messages sent by its
  anonymous administrators"
- from: "For backward compatibility, if the message was sent on behalf
  of a chat, the field contains a fake sender user in non-channel chats"

So `sender_chat.ID == chat.ID` is a safe admin signal. Added an
isAnonymousGroupAdmin helper next to isLinkedChannel and folded it into
fromSuper. /report is still not a super command, so anonymous /report
now stops at the anonymous-admin skip branch in procEvents (no user
report is filed either — the pseudo-user can never be an approved
reporter).

Tests:
- TestTelegramListener_IsAnonymousGroupAdmin unit-covers the helper
- TestTelegramListener_AnonymousAdminBanSpam drives /ban, /spam, /warn
  through Do() with the exact update shape captured in production
  (verified to fail on master when only the fromSuper wiring is reverted:
  no ban, no spam training, no warning, no delete)
- Existing TestTelegramListener_DoUserReportCommand subtest
  "anonymous admin reply is left alone, not consumed as a report"
  updated: /spam and spam now flow through the super path (delete +
  OnMessage), /report still s... (continued)

10 of 10 new or added lines in 2 files covered. (100.0%)

2 existing lines in 1 file now uncovered.

9416 of 11118 relevant lines covered (84.69%)

240.55 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
94.24
-0.21% lib/tgspam/detector.go
Jobs
ID Job ID Ran Files Coverage
1 36024115588.1 24 Sep 2026 04:04PM UTC 44
84.69
GitHub Action Run
Source Files on build 36024115588
  • Tree
  • List 44
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • d28ef13b on github
  • Prev Build on master (#35679574726)
  • Next Build on master (#36025480366)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc