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

umputun / tg-spam
83%

Build:
DEFAULT BRANCH: master
Repo Added 06 Dec 2023 12:31AM UTC
Files 41
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

LAST BUILD ON BRANCH master
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • 12-provide-flag-to-not-remove-user-after-unban
  • abnormal-spacing
  • add-from-detected-spam
  • add-lua-user-fields
  • add-shell-completions
  • add-slog
  • admin-info
  • alkk/master
  • approved-users-ui
  • audio-check
  • autoadd-ham
  • ban-user-instead-of-restriction
  • callback
  • cas-retry-fix
  • check-by-id
  • ci/workflow-hardening
  • classifier-unlearn
  • clean-invisible-chars
  • clean-msg-fix
  • db-backup
  • dedup-samples
  • dependabot
  • dependabot/github_actions/github-actions-updates-20c91dd2a4
  • dependabot/github_actions/github-actions-updates-fcf4e41b5c
  • dependabot/go_modules/_examples/simplechat/github.com/umputun/tg-spam-1.18.0
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-0c570b14c2
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-28ef041b99
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-2c4077a24b
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-4af97a05b0
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-75e783174d
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-796ea05e18
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-8d185506e8
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-9e39e63601
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-aed0a436bf
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-b841ea8733
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-d503fb43d4
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-dd111468ba
  • dependabot/go_modules/_examples/simplechat/go-modules-updates-e06798f191
  • dependabot/go_modules/_examples/simplechat/modernc.org/sqlite-1.37.0
  • dependabot/go_modules/github.com/go-pkgz/testutils-0.4.2
  • dependabot/go_modules/go-modules-updates-589f0c7bc4
  • dependabot/go_modules/go-modules-updates-75e783174d
  • dependabot/go_modules/go-modules-updates-796ea05e18
  • dependabot/go_modules/go-modules-updates-94abde7b92
  • dependabot/go_modules/go-modules-updates-db89e520f1
  • dependabot/go_modules/go_modules-232a611e2d
  • dependabot/go_modules/go_modules-5a9c29dde4
  • dependabot/go_modules/go_modules-9c5197dcb8
  • dependabot/go_modules/go_modules-acb2299ea6
  • dependabot/go_modules/go_modules-c8c7c79cc3
  • dependabot/go_modules/go_modules-dd7da38a6b
  • detect-story
  • detector-persist
  • download-spam-button
  • drop-chi
  • dyn-update
  • easy-install-docs
  • eliminate-obsolete-flag
  • emoji-optimization
  • empty-text-locator
  • exact-match-stopwords
  • extra-delete-ids
  • extract-lib
  • faster-removal
  • feat/csrf-protection
  • feat/dictionary-management-ui
  • feat/e2e-ui-tests
  • feat/handle-edited-messages
  • feat/meta-contact-only-354
  • feat/sqlite-to-postgres-converter
  • feature-297-openai-thinking
  • feature-custom-prompts
  • feature-db-configuration
  • feature-lua-plugins
  • feature/add-spam-filter
  • feature/aggressive-cleanup
  • feature/auto-ban-threshold
  • feature/bot-no-sound
  • feature/delete-system-messages
  • feature/digitalocean-deployment
  • feature/duplicate-detection
  • feature/duplicate-detection-aggressive-cleanup
  • feature/info-on-unban
  • feature/issue92
  • feature/keyboard-detection
  • feature/max-short-msg-count-399
  • feature/mentions-limit
  • feature/openai-check-short-messages
  • feature/report-enhancements
  • feature/resend-orig-msg
  • feature/silent-messages
  • feature/user-spam-reporting
  • feature/username-symbols-check
  • feature/username-userid-stopwords
  • fix-174
  • fix-183
  • fix-295-giveaway-forwards
  • fix-304-reasoning-effort
  • fix-admin-error-propagation
  • fix-ci-caching
  • fix-ci-disk-space
  • fix-firstmgs-count
  • fix-forward-detection
  • fix-gpt5-max-tokens-support
  • fix-info-button-markdown-escaping
  • fix-issue-223
  • fix-openai-short-msg-veto-335
  • fix-optional-user-id
  • fix-orphaned-report-deletion-343
  • fix-samples-migration
  • fix-settings-formatting
  • fix-spam-command-quote-handling
  • fix-stopword-space-normalization
  • fix-video-listener-event
  • fix/381-auth-hash
  • fix/anonymous-admin-posts-skip-spam-check
  • fix/caption-link-entities
  • fix/channel-ban-370
  • fix/check-quoted-text-for-spam
  • fix/confdb-reload-and-merge-artefacts
  • fix/dictionary-import-and-forum-reports
  • fix/duplicate-detection-message-edits
  • fix/image-caption-mentions
  • fix/image-only-spam-reporting
  • fix/issue-348-validate-bot-username
  • fix/issue107
  • fix/media-short-text-detection
  • fix/rest-writeheader-renderjson
  • fix/short-message-approval
  • forward-check
  • hashed-web-passwd
  • ignore-classifier
  • imporve-hist-openai
  • improved-settings-page
  • letterlikе
  • lib-example
  • linked-channel-admin
  • links-only
  • linter-v2-migration
  • loading-indicator-delete
  • master
  • meta-checks
  • min-spam-probability
  • more-commands
  • more-ui
  • multi-first
  • multi-lang
  • multi-storage
  • negative-time
  • no-giveaway
  • normalize-spam-text
  • opeani-ignore
  • open-ai
  • openai-apibase
  • openai-veto
  • optimize-exclude-match
  • optimize-sample-loader
  • paskal/bump_modules
  • paskal/claude
  • paskal/dependabot-disable-updates
  • paskal/dependabot-security-updates
  • paskal/dockerfile_comment
  • paskal/fix_ci
  • paskal/fix_golangci_lint
  • paskal/fix_typos
  • paskal/go-flags
  • paskal/openai_doc
  • paskal/remove-unused-code
  • paskal/remove_unused_moq
  • paskal/small-fixes
  • paskal/switch_to_newer_tb_lib
  • paskal/test_examples
  • paskal/update_doc_and_readme
  • paskal/update_modules
  • paskal/use_ghcrio
  • patch-1
  • persistent-locator
  • persitent-ids
  • pic-caption
  • reaction-spam-detection
  • refactor-admin
  • refs/tags/v0.1.0
  • refs/tags/v0.1.1
  • refs/tags/v0.2.0
  • refs/tags/v0.2.1
  • refs/tags/v0.2.2
  • refs/tags/v0.2.3
  • refs/tags/v0.2.4
  • refs/tags/v1.0.0
  • refs/tags/v1.0.1
  • refs/tags/v1.1.0
  • refs/tags/v1.1.2
  • refs/tags/v1.10.0
  • refs/tags/v1.10.1
  • refs/tags/v1.10.2
  • refs/tags/v1.10.3
  • refs/tags/v1.11.0
  • refs/tags/v1.11.1
  • refs/tags/v1.11.2
  • refs/tags/v1.11.3
  • refs/tags/v1.11.4
  • refs/tags/v1.11.5
  • refs/tags/v1.11.6
  • refs/tags/v1.12.0
  • refs/tags/v1.12.1
  • refs/tags/v1.12.2
  • refs/tags/v1.13.0
  • refs/tags/v1.13.1
  • refs/tags/v1.13.2
  • refs/tags/v1.13.3
  • refs/tags/v1.13.4
  • refs/tags/v1.13.5
  • refs/tags/v1.13.6
  • refs/tags/v1.14.0
  • refs/tags/v1.14.1
  • refs/tags/v1.14.2
  • refs/tags/v1.14.3
  • refs/tags/v1.15.0
  • refs/tags/v1.16.0
  • refs/tags/v1.16.1
  • refs/tags/v1.16.2
  • refs/tags/v1.16.3
  • refs/tags/v1.17.0
  • refs/tags/v1.18.0
  • refs/tags/v1.18.1
  • refs/tags/v1.19.0
  • refs/tags/v1.19.2
  • refs/tags/v1.2.0
  • refs/tags/v1.2.1
  • refs/tags/v1.2.2
  • refs/tags/v1.2.3
  • refs/tags/v1.2.4
  • refs/tags/v1.2.5
  • refs/tags/v1.20.0
  • refs/tags/v1.20.1
  • refs/tags/v1.21.0
  • refs/tags/v1.22.0
  • refs/tags/v1.23.0
  • refs/tags/v1.23.1
  • refs/tags/v1.23.2
  • refs/tags/v1.23.3
  • refs/tags/v1.23.4
  • refs/tags/v1.23.5
  • refs/tags/v1.23.6
  • refs/tags/v1.23.7
  • refs/tags/v1.24.0
  • refs/tags/v1.25.0
  • refs/tags/v1.3.0
  • refs/tags/v1.3.1
  • refs/tags/v1.4.0
  • refs/tags/v1.4.1
  • refs/tags/v1.4.2
  • refs/tags/v1.5.0
  • refs/tags/v1.5.1
  • refs/tags/v1.5.2
  • refs/tags/v1.5.3
  • refs/tags/v1.6.0
  • refs/tags/v1.6.1
  • refs/tags/v1.7.0
  • refs/tags/v1.8.0
  • refs/tags/v1.8.1
  • refs/tags/v1.8.2
  • refs/tags/v1.8.3
  • refs/tags/v1.9.0
  • remove-from-aproved
  • reply-ban
  • req-history
  • restore-configurable-auth-user
  • retry-openai
  • retry-plain
  • rt-aproved-save
  • settings-ui
  • small-screen-styles
  • soft-ban
  • softmax_float64_underflow
  • spam-storage
  • sqlite-all
  • supers-by-id
  • training-ban
  • training-mode
  • unban-confirm
  • universal-multilang
  • update-go-1.25
  • v1.4.2
  • video-check
  • volume-warns
  • warn-auto-ban
  • web-checker
  • webapi
  • worktree-recent-bot-users
  • would

29 Apr 2026 09:24PM UTC coverage: 83.419% (+0.1%) from 83.275%
25134669663

push

github

web-flow
feat: short-message flood detection for unapproved users (#400)

* docs(claude): add wiring-layers checklist for new config parameters

Codifies the requirement that any new configurable parameter (CLI flag, env
var, or tunable knob) must be wired through CLI/env definition, DB-backed
config, web settings UI, e2e UI test, and README. Recurring source of
partially-broken features when one layer is missed.

* feat: add max-short-msg-count short-message flood detection

Adds an opt-in spam check that bans an unapproved user when their locator
message count minus approved count crosses --max-short-msg-count, and the
current message is short. Closes the gap left by content-based checks for
spammers probing the channel with innocuous one-word messages ("hi",
"hello", "yo") that individually evade similarity, classifier, LLM, and
duplicate detectors.

State is derived from the existing messages table via the
idx_messages_gid_user_id_time index — no new in-memory counter, no cache,
restart-resilient by construction. The check is implemented as an internal
method on Detector (isShortMsgFlood), gated by an outer guard so disabled
mode does no work, and bypasses LLM consensus by design (behavioral signal
not subject to content-based override).

Wired through all required layers per CLAUDE.md: CLI flag and env var
(--max-short-msg-count / MAX_SHORT_MSG_COUNT), DB-backed Settings with
zero-aware semantics, web settings UI form field plus read-only display,
e2e UI round-trip test, and README documentation. Respects training, dry,
and soft-ban modes via the existing pipeline. Disabled by default
(MaxShortMsgCount=0) and incompatible with paranoid mode (validated at
startup).

Related to #399

* docs(plans): max-short-msg-count implementation plan

Captures the design decisions, wiring layers, edge cases, and task
breakdown for the short-message flood detection feature. Filed under
completed/ since the implementation has landed.

Related to #399

* fix: trim README s... (continued)

95 of 97 new or added lines in 5 files covered. (97.94%)

8452 of 10132 relevant lines covered (83.42%)

227.44 hits per line

Relevant lines Covered
Build:
Build:
10132 RELEVANT LINES 8452 COVERED LINES
227.44 HITS PER LINE
Source Files on master
  • Tree
  • List 41
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
25134669663 master feat: short-message flood detection for unapproved users (#400) * docs(claude): add wiring-layers checklist for new config parameters Codifies the requirement that any new configurable parameter (CLI flag, env var, or tunable knob) must be wired... push 29 Apr 2026 09:28PM UTC web-flow github
83.42
25133013538 feature/max-short-msg-count-399 fix: trim README short-msg-flood section and clarify approved-user guard Two refinements from post-implementation review: - README.md: drop the trigger-formula code block, locator-derivation paragraph, separate "When triggered" paragraph, dedi... Pull #400 29 Apr 2026 08:51PM UTC umputun github
83.42
25131459943 feature/max-short-msg-count-399 docs(plans): max-short-msg-count implementation plan Captures the design decisions, wiring layers, edge cases, and task breakdown for the short-message flood detection feature. Filed under completed/ since the implementation has landed. Related ... push 29 Apr 2026 08:17PM UTC umputun github
83.41
25123809667 master test(tgspam): cover short-message LLM ham clear vs approval counter Adds a subtest under TestDetector_ShortMessageApproval verifying that when CheckShortMessagesWithOpenAI is enabled and the LLM clears a short message as ham, the approval counter... push 29 Apr 2026 05:31PM UTC umputun github
83.28
25035848305 master Add warn auto-ban for repeated admin /warn commands (#398) * add plan: warn-auto-ban * feat: add Warnings storage layer for warn auto-ban Add per-event log table tracking admin /warn commands per (gid, user_id). Mirrors the Reports storage patt... push 28 Apr 2026 05:39AM UTC web-flow github
83.28
25035708813 warn-auto-ban fix: harden warn auto-ban against negative thresholds Address Copilot review on PR #398: - admin.go: gate warn auto-ban with `warnThreshold <= 0` instead of `== 0` to match the existing `Report.AutoBanThreshold > 0` convention. Without this,... Pull #398 28 Apr 2026 05:34AM UTC umputun github
83.28
25035710228 warn-auto-ban fix: harden warn auto-ban against negative thresholds Address Copilot review on PR #398: - admin.go: gate warn auto-ban with `warnThreshold <= 0` instead of `== 0` to match the existing `Report.AutoBanThreshold > 0` convention. Without this,... Pull #398 28 Apr 2026 05:34AM UTC umputun github
83.28
25035412437 warn-auto-ban test(e2e): wait for htmx settle before clicking delete TestManageSamples_DeleteSpam was racing with HTMX in headed mode: the test clicked the newly-swapped delete button before HTMX bound hx-post to it, causing the form to fall back to a native P... Pull #398 28 Apr 2026 05:24AM UTC umputun github
83.27
25030940684 master Implement database configuration support (#294) * Implement database configuration support - Add generic Config storage component with type-safe configuration storage - Add CLI flag --confdb to load configuration from database - Add save-config ... push 28 Apr 2026 02:44AM UTC web-flow github
83.08
24966212061 feature-db-configuration fix: preserve InstanceID across loadConfigFromDB swap; rename collided subtests (#397) * fix: preserve InstanceID across loadConfigFromDB swap; rename collided subtests `loadConfigFromDB` does `*settings = *dbSettings` which clobbers the CLI/env... Pull #294 26 Apr 2026 08:25PM UTC web-flow github
83.08
See All Builds (1340)
  • Repo on GitHub
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

© 2026 Coveralls, Inc