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

umputun / tg-spam / 19440815139
83%

Build:
DEFAULT BRANCH: master
Ran 17 Nov 2025 06:51PM UTC
Jobs 1
Files 31
Run time 26min
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

17 Nov 2025 06:47PM UTC coverage: 81.939% (+0.02%) from 81.917%
19440815139

push

github

web-flow
feat: validate bot username in /report@botname commands (#349)

* feat: validate bot username in /report@botname commands

only process /report@botname when botname matches actual bot username to prevent commands intended for other bots from being consumed.

changes:
- add BotUsername field to TelegramListener struct
- convert isReportCommand to method for access to bot username
- implement case-insensitive username comparison (telegram standard)
- handle edge cases: empty username, trailing whitespace, extra text
- reject @mention variants when bot username not configured (security)
- add comprehensive tests for all command variants and edge cases

Related to #348

* chore: add bot username to debug log output

* fix: prevent panic on whitespace-only username in /report@

use Fields to extract username and check for empty slice before accessing to avoid panic when afterAt contains only whitespace characters like tab or newline. this makes the code more defensive even though the initial TrimSpace already handles most cases.

add test cases for tab and newline after @ to ensure proper handling.

21 of 25 new or added lines in 2 files covered. (84.0%)

6211 of 7580 relevant lines covered (81.94%)

271.78 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
78.39
0.66% app/events/listener.go
3
62.68
-0.08% app/main.go
Jobs
ID Job ID Ran Files Coverage
1 19440815139.1 17 Nov 2025 06:51PM UTC 31
81.94
GitHub Action Run
Source Files on build 19440815139
  • Tree
  • List 31
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • a0a86b3b on github
  • Prev Build on master (#19417593680)
  • Next Build on master (#19528169324)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc