selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

tg-spam logo

Self-host tg-spam

v1.29.1

Bayesian anti-spam bot and API server for Telegram groups

ReleaseOpen SourceMIT
Updated14 hours ago
LanguageGo
Setup difficultyEasy
Stars
453
Port
8080 (webapi server and WEB UI, only when the server is enabled with --server.enabled)
Docker
umputun/tg-spam
Install with Docker Compose
Web UI message checker page for testing a message against spam detectionWeb UI page for adding, viewing and deleting spam and ham samplesWeb UI page for viewing and controlling the approved users list

What is tg-spam?

A Go-based bot that guards a Telegram group chat: it inspects each post and, when spam is recognised, removes the message and bans the poster. Judgement comes from a stack of checks - a Bayes classifier over spam and ham samples, a similarity comparison against those samples, a stop-phrase list, counters for emoji, links, mentions and media-only posts, abnormal spacing, repeated messages and reaction floods, plus a lookup in the public Combot Anti-Spam database. Optional calls to OpenAI, Google Gemini or the jev decision model can add evidence or veto the outcome, and Lua scripts extend detection without touching the codebase. Admins keep teaching it by forwarding spam into an admin chat or unbanning a false positive, while dry, training and soft-ban settings allow careful tuning on a live group. The same engine can also run headless as an HTTP endpoint for other tools, behind a basic-auth web panel for editing samples, dictionaries and approved users, or as a Go library. Deployment is a single Docker container (or one of the release binaries) needing only a bot token and a group id, with data kept in SQLite by default or PostgreSQL; each instance covers one group.

Should you self-host tg-spam?

tg-spam scores 52/100 on selfhost.directory (how scoring works) and ranks #3 of 4 in Anti-Spam. It has 453 GitHub stars.

It shipped 15 stable releases in the past year. The latest, v1.29.1, came out on 27 October 2026. New versions land roughly every 3 weeks.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is MIT-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is Rspamd (65/100, 2 559 stars). It scores higher overall, so compare the two before you pick. See tg-spam vs Rspamd side by side.

Features

  • Admin chat with inline moderation buttons
  • Automated message moderation
  • Automatic backup on upgrade
  • Bayesian spam classificationactive only when both ham and spam samples are present
  • Crowdsourced user spam reporting
  • Custom Lua plugins
  • Dry-run, training and soft-ban modes
  • Learning from admin feedback
  • LLM spam analysisdisabled until an API token is set
  • Metadata checks (links, emoji, media)
  • REST APIdisabled by default, enable with --server.enabled
  • Spam similarity check
  • Stop words filtering
  • Web admin UIserved by the same optional web server, behind basic auth

tg-spam README

How to install tg-spam

Install tg-spam with Docker Compose

Environment variables
TZ, TELEGRAM_TOKEN, TELEGRAM_GROUP, ADMIN_GROUP, LOGGER_ENABLED, REPORT_ENABLED
services:
  
  tg-spam:
    image: ghcr.io/umputun/tg-spam:latest
    hostname: tg-spam
    restart: always
    container_name: tg-spam
    user: "1000:1000" # set uid:gid to host user to avoid permission issues with mounted volumes
    environment:
      - TZ=America/Chicago
      - TELEGRAM_TOKEN=ххххх
      - TELEGRAM_GROUP=example_chat # public group name to monitor and protect
      - ADMIN_GROUP=-403767890 # private group id for admin spam-reports
      - LOGGER_ENABLED=true
      - LOGGER_FILE=/srv/log/tg-spam.log
      - LOGGER_MAX_SIZE=5M
      - NO_SPAM_REPLY=true
      - DEBUG=true
      - REPORT_ENABLED=true # enable user spam reporting
    volumes:
      - ./log/tg-spam:/srv/log
      - ./var/tg-spam:/srv/var
    command: --super=name1 --super=name2 --super=name3

Official docker-compose.yml example from the docs.

How to configure tg-spam

  • --admin.groupAdmin group name or channel id that receives spam reports (env: ADMIN_GROUP)

    Admin group name or channel id that receives spam reports (env: ADMIN_GROUP)

  • --aggressive-cleanupDelete a spammer's recent messages when banned via the /spam command (env: AGGRESSIVE_CLEANUP)

    Delete a spammer's recent messages when banned via the /spam command (env: AGGRESSIVE_CLEANUP)

    values: true/false

  • --aggressive-cleanup-limit100Maximum number of messages to delete per user in aggressive cleanup mode (env: AGGRESSIVE_CLEANUP_LIMIT)

    Maximum number of messages to delete per user in aggressive cleanup mode (env: AGGRESSIVE_CLEANUP_LIMIT)

  • --cas.apihttps://api.cas.chatCombot Anti-Spam API base; set to empty string to disable CAS checks (env: CAS_API)

    Combot Anti-Spam API base; set to empty string to disable CAS checks (env: CAS_API)

  • --cas.timeout5sCAS request timeout (env: CAS_TIMEOUT)

    CAS request timeout (env: CAS_TIMEOUT)

  • --cas.user-agentCustom User-Agent header for CAS API requests (env: CAS_USER_AGENT)

    Custom User-Agent header for CAS API requests (env: CAS_USER_AGENT)

  • --confdbLoad configuration from the database instead of flags only (env: CONFDB)

    Load configuration from the database instead of flags only (env: CONFDB)

    values: true/false

  • --confdb-encrypt-keyMaster key (at least 20 chars) encrypting sensitive config values in the database (env: CONFDB_ENCRYPT_KEY)

    Master key (at least 20 chars) encrypting sensitive config values in the database (env: CONFDB_ENCRYPT_KEY)

  • --convertenabledConversion mode for txt samples and other storage files into the database

    Conversion mode for txt samples and other storage files into the database

    values: only | enabled | disabled

  • --dbtg-spam.dbDatabase URL, sqlite://path/to/db.db or postgres://user:password@host:port/dbname (env: DB)

    Database URL, sqlite://path/to/db.db or postgres://user:password@host:port/dbname (env: DB)

    values: sqlite:// or postgres:// URL

  • --dbgDebug mode (env: DEBUG)

    Debug mode (env: DEBUG)

    values: true/false

  • --delete.join-messagesImmediately delete all join messages (env: DELETE_JOIN_MESSAGES)

    Immediately delete all join messages (env: DELETE_JOIN_MESSAGES)

    values: true/false

  • --delete.leave-messagesImmediately delete all leave messages (env: DELETE_LEAVE_MESSAGES)

    Immediately delete all leave messages (env: DELETE_LEAVE_MESSAGES)

    values: true/false

  • --disable-admin-spam-forwardDo not treat messages forwarded to the admin group as spam (env: DISABLE_ADMIN_SPAM_FORWARD)

    Do not treat messages forwarded to the admin group as spam (env: DISABLE_ADMIN_SPAM_FORWARD)

    values: true/false

  • --dryDry mode, detection without bans (env: DRY)

    Dry mode, detection without bans (env: DRY)

    values: true/false

  • --duplicates.threshold0Number of identical messages that triggers spam detection; 0 disables (env: DUPLICATES_THRESHOLD)

    Number of identical messages that triggers spam detection; 0 disables (env: DUPLICATES_THRESHOLD)

  • --duplicates.window1hTime window for duplicate detection (env: DUPLICATES_WINDOW)

    Time window for duplicate detection (env: DUPLICATES_WINDOW)

  • --files.dynamicdataDynamic data path; in Docker leave the default /srv/data and mount a volume (env: FILES_DYNAMIC)

    Dynamic data path; in Docker leave the default /srv/data and mount a volume (env: FILES_DYNAMIC)

  • --files.samplesSamples data path, defaults to the dynamic data path (env: FILES_SAMPLES)

    Samples data path, defaults to the dynamic data path (env: FILES_SAMPLES)

  • --files.watch-interval5sWatch interval for dynamic files, deprecated (env: FILES_WATCH_INTERVAL)

    Watch interval for dynamic files, deprecated (env: FILES_WATCH_INTERVAL)

  • --first-messages-count1How many first messages from a user are checked (env: FIRST_MESSAGES_COUNT)

    How many first messages from a user are checked (env: FIRST_MESSAGES_COUNT)

  • --gemini.check-short-messagesAlso send short messages to Gemini (env: GEMINI_CHECK_SHORT_MESSAGES)

    Also send short messages to Gemini (env: GEMINI_CHECK_SHORT_MESSAGES)

    values: true/false

  • --gemini.custom-promptAdditional custom Gemini prompts for specific spam patterns (env: GEMINI_CUSTOM_PROMPT)

    Additional custom Gemini prompts for specific spam patterns (env: GEMINI_CUSTOM_PROMPT)

  • --gemini.history-size0Number of preceding messages included as context for Gemini (env: GEMINI_HISTORY_SIZE)

    Number of preceding messages included as context for Gemini (env: GEMINI_HISTORY_SIZE)

  • --gemini.max-symbols-request8192Maximum symbols in the Gemini request (env: GEMINI_MAX_SYMBOLS_REQUEST)

    Maximum symbols in the Gemini request (env: GEMINI_MAX_SYMBOLS_REQUEST)

  • --gemini.max-tokens-response1024Maximum tokens in the Gemini response (env: GEMINI_MAX_TOKENS_RESPONSE)

    Maximum tokens in the Gemini response (env: GEMINI_MAX_TOKENS_RESPONSE)

  • --gemini.modelgemma-4-31b-itGemini model name (env: GEMINI_MODEL)

    Gemini model name (env: GEMINI_MODEL)

  • --gemini.promptGemini system prompt; builtin default is used when empty (env: GEMINI_PROMPT)

    Gemini system prompt; builtin default is used when empty (env: GEMINI_PROMPT)

  • --gemini.retry-count1Gemini retry count (env: GEMINI_RETRY_COUNT)

    Gemini retry count (env: GEMINI_RETRY_COUNT)

  • --gemini.tokenGoogle Gemini API key; integration disabled if not set (env: GEMINI_TOKEN)

    Google Gemini API key; integration disabled if not set (env: GEMINI_TOKEN)

  • --gemini.vetoVeto mode for Gemini, confirm detected spam (env: GEMINI_VETO)

    Veto mode for Gemini, confirm detected spam (env: GEMINI_VETO)

    values: true/false

  • --history-duration24hHow long message hashes are kept in the internal lookup cache (env: HISTORY_DURATION)

    How long message hashes are kept in the internal lookup cache (env: HISTORY_DURATION)

  • --history-min-size1000Minimum number of messages kept in the internal cache (env: HISTORY_MIN_SIZE)

    Minimum number of messages kept in the internal cache (env: HISTORY_MIN_SIZE)

  • --history-size100History size of last messages kept (env: LAST_MSGS_HISTORY_SIZE)

    History size of last messages kept (env: LAST_MSGS_HISTORY_SIZE)

  • HTTP_PROXYHTTP proxy for the bot's outbound requests; NO_PROXY can carve out exceptions

    HTTP proxy for the bot's outbound requests; NO_PROXY can carve out exceptions

  • HTTPS_PROXYStandard Go proxy variables honoured for api.telegram.org and other HTTPS endpoints; schemes http, https, socks5, socks5h

    Standard Go proxy variables honoured for api.telegram.org and other HTTPS endpoints; schemes http, https, socks5, socks5h

  • --instance-idtg-spamInstance id, lets several bots share one database (env: INSTANCE_ID)

    Instance id, lets several bots share one database (env: INSTANCE_ID)

  • --jev.apibaseCustom jev API base; setting it alone does not enable the provider (env: JEV_API_BASE)

    Custom jev API base; setting it alone does not enable the provider (env: JEV_API_BASE)

  • --jev.check-short-messagesAlso send short messages to jev (env: JEV_CHECK_SHORT_MESSAGES)

    Also send short messages to jev (env: JEV_CHECK_SHORT_MESSAGES)

    values: true/false

  • --jev.criteria-hamjev criteria describing ham (env: JEV_CRITERIA_HAM)

    jev criteria describing ham (env: JEV_CRITERIA_HAM)

  • --jev.criteria-spamjev criteria describing spam (env: JEV_CRITERIA_SPAM)

    jev criteria describing spam (env: JEV_CRITERIA_SPAM)

  • --jev.gibberish-threshold0Gibberish probability at or above which a message is spam; 0 disables (env: JEV_GIBBERISH_THRESHOLD)

    Gibberish probability at or above which a message is spam; 0 disables (env: JEV_GIBBERISH_THRESHOLD)

  • --jev.history-size0jev history size, preceding messages used as context (env: JEV_HISTORY_SIZE)

    jev history size, preceding messages used as context (env: JEV_HISTORY_SIZE)

  • --jev.max-symbols-request6000Maximum symbols in the jev request (env: JEV_MAX_SYMBOLS_REQUEST)

    Maximum symbols in the jev request (env: JEV_MAX_SYMBOLS_REQUEST)

  • --jev.modeljev-1.13.0jev model, a pinned version rather than an alias (env: JEV_MODEL)

    jev model, a pinned version rather than an alias (env: JEV_MODEL)

  • --jev.questionThe spam question asked to jev (env: JEV_QUESTION)

    The spam question asked to jev (env: JEV_QUESTION)

  • --jev.retry-count1jev retry count (env: JEV_RETRY_COUNT)

    jev retry count (env: JEV_RETRY_COUNT)

  • --jev.threshold0.30Spam probability at or above which a message is spam (env: JEV_THRESHOLD)

    Spam probability at or above which a message is spam (env: JEV_THRESHOLD)

  • --jev.tokenjev API key from typesafe.ai; integration disabled if not set (env: JEV_TOKEN)

    jev API key from typesafe.ai; integration disabled if not set (env: JEV_TOKEN)

  • --jev.vetoVeto mode for jev, confirm detected spam (env: JEV_VETO)

    Veto mode for jev, confirm detected spam (env: JEV_VETO)

    values: true/false

  • --llm.consensusanyHow eligible LLMs flip the base decision (env: LLM_CONSENSUS)

    How eligible LLMs flip the base decision (env: LLM_CONSENSUS)

    values: any | all

  • --llm.request-timeout30sTimeout for individual LLM requests (env: LLM_REQUEST_TIMEOUT)

    Timeout for individual LLM requests (env: LLM_REQUEST_TIMEOUT)

  • --logger.enabledEnable rotated spam logs to file (env: LOGGER_ENABLED)

    Enable rotated spam logs to file (env: LOGGER_ENABLED)

    values: true/false

  • --logger.filetg-spam.logLocation of the spam log file (env: LOGGER_FILE)

    Location of the spam log file (env: LOGGER_FILE)

  • --logger.max-backups10Number of old compressed log files to retain (env: LOGGER_MAX_BACKUPS)

    Number of old compressed log files to retain (env: LOGGER_MAX_BACKUPS)

  • --logger.max-size100MMaximum log size before rotation (env: LOGGER_MAX_SIZE)

    Maximum log size before rotation (env: LOGGER_MAX_SIZE)

  • --lua-plugins.dynamic-reloadReload plugins dynamically when they change (env: LUA_PLUGINS_DYNAMIC_RELOAD)

    Reload plugins dynamically when they change (env: LUA_PLUGINS_DYNAMIC_RELOAD)

    values: true/false

  • --lua-plugins.enabledEnable Lua plugins (env: LUA_PLUGINS_ENABLED)

    Enable Lua plugins (env: LUA_PLUGINS_ENABLED)

    values: true/false

  • --lua-plugins.enabled-pluginsList of enabled plugins by name, without the .lua extension (env: LUA_PLUGINS_ENABLED_PLUGINS)

    List of enabled plugins by name, without the .lua extension (env: LUA_PLUGINS_ENABLED_PLUGINS)

  • --lua-plugins.plugins-dirDirectory containing the Lua plugins (env: LUA_PLUGINS_PLUGINS_DIR)

    Directory containing the Lua plugins (env: LUA_PLUGINS_PLUGINS_DIR)

  • --lua-plugins.unrestrictedGive plugins access to every Lua library, os and io included (env: LUA_PLUGINS_UNRESTRICTED)

    Give plugins access to every Lua library, os and io included (env: LUA_PLUGINS_UNRESTRICTED)

    values: true/false

  • --max-backups10Maximum number of upgrade backups to keep; 0 disables automatic backups (env: MAX_BACKUPS)

    Maximum number of upgrade backups to keep; 0 disables automatic backups (env: MAX_BACKUPS)

  • --max-emoji2Maximum emoji count in a message (env: MAX_EMOJI)

    Maximum emoji count in a message (env: MAX_EMOJI)

    values: -1 to disable check

  • --max-short-msg-count0Ban an unapproved user after N short messages without graduation; 0 disables (env: MAX_SHORT_MSG_COUNT)

    Ban an unapproved user after N short messages without graduation; 0 disables (env: MAX_SHORT_MSG_COUNT)

  • --message.drythis is spam (dry mode)Message sent when spam is detected in dry mode (env: MESSAGE_DRY)

    Message sent when spam is detected in dry mode (env: MESSAGE_DRY)

  • --message.spamthis is spamMessage sent to the group when spam is detected (env: MESSAGE_SPAM)

    Message sent to the group when spam is detected (env: MESSAGE_SPAM)

  • --message.startupMessage sent to the group when the bot starts, may be empty (env: MESSAGE_STARTUP)

    Message sent to the group when the bot starts, may be empty (env: MESSAGE_STARTUP)

  • --message.warnWarning message used by the /warn command (env: MESSAGE_WARN)

    Warning message used by the /warn command (env: MESSAGE_WARN)

  • --meta.audio-onlyEnable audio-only check (env: META_AUDIO_ONLY)

    Enable audio-only check (env: META_AUDIO_ONLY)

    values: true/false

  • --meta.contact-onlyEnable contact-only check (env: META_CONTACT_ONLY)

    Enable contact-only check (env: META_CONTACT_ONLY)

    values: true/false

  • --meta.document-onlyEnable document-only check (env: META_DOCUMENT_ONLY)

    Enable document-only check (env: META_DOCUMENT_ONLY)

    values: true/false

  • --meta.external-replyEnable external reply check (env: META_EXTERNAL_REPLY)

    Enable external reply check (env: META_EXTERNAL_REPLY)

    values: true/false

  • --meta.forwardEnable forwarded-message check (env: META_FORWARD)

    Enable forwarded-message check (env: META_FORWARD)

    values: true/false

  • --meta.giveawayEnable giveaway check (env: META_GIVEAWAY)

    Enable giveaway check (env: META_GIVEAWAY)

    values: true/false

  • --meta.image-onlyFlag messages containing images but no text as spam (env: META_IMAGE_ONLY)

    Flag messages containing images but no text as spam (env: META_IMAGE_ONLY)

    values: true/false

  • --meta.image-text-len0Minimum text length for image messages; 0 falls back to min-msg-len (env: META_IMAGE_TEXT_LEN)

    Minimum text length for image messages; 0 falls back to min-msg-len (env: META_IMAGE_TEXT_LEN)

  • --meta.keyboardEnable keyboard check (env: META_KEYBOARD)

    Enable keyboard check (env: META_KEYBOARD)

    values: true/false

  • --meta.links-limit-1Maximum number of links in a message; marks spam above the limit (env: META_LINKS_LIMIT)

    Maximum number of links in a message; marks spam above the limit (env: META_LINKS_LIMIT)

    values: -1 disables the check

  • --meta.links-onlyEnable links-only check (env: META_LINKS_ONLY)

    Enable links-only check (env: META_LINKS_ONLY)

    values: true/false

  • --meta.mention-onlyEnable mention-only check (env: META_MENTION_ONLY)

    Enable mention-only check (env: META_MENTION_ONLY)

    values: true/false

  • --meta.mentions-limit-1Maximum number of @username mentions in a message (env: META_MENTIONS_LIMIT)

    Maximum number of @username mentions in a message (env: META_MENTIONS_LIMIT)

    values: -1 disables the check

  • --meta.username-symbolsProhibited symbols in username (env: META_USERNAME_SYMBOLS)

    Prohibited symbols in username (env: META_USERNAME_SYMBOLS)

    values: disabled by default

  • --meta.video-onlyEnable video-only check (env: META_VIDEO_ONLY)

    Enable video-only check (env: META_VIDEO_ONLY)

    values: true/false

  • --min-msg-len50Minimum message length to check (env: MIN_MSG_LEN)

    Minimum message length to check (env: MIN_MSG_LEN)

  • --min-probability50Minimum spam probability percent required to ban (env: MIN_PROBABILITY)

    Minimum spam probability percent required to ban (env: MIN_PROBABILITY)

  • --multi-lang0Number of words in different languages to consider as spam (env: MULTI_LANG)

    Number of words in different languages to consider as spam (env: MULTI_LANG)

  • --no-spam-replyDo not reply to spam messages in the group (env: NO_SPAM_REPLY)

    Do not reply to spam messages in the group (env: NO_SPAM_REPLY)

    values: true/false

  • --openai.apibasehttps://api.openai.com/v1Custom OpenAI-compatible API base (env: OPENAI_API_BASE)

    Custom OpenAI-compatible API base (env: OPENAI_API_BASE)

  • --openai.check-short-messagesAlso send messages shorter than min-msg-len to OpenAI (env: OPENAI_CHECK_SHORT_MESSAGES)

    Also send messages shorter than min-msg-len to OpenAI (env: OPENAI_CHECK_SHORT_MESSAGES)

    values: true/false

  • --openai.custom-promptAdditional custom prompts for specific spam patterns (env: OPENAI_CUSTOM_PROMPT)

    Additional custom prompts for specific spam patterns (env: OPENAI_CUSTOM_PROMPT)

  • --openai.history-size0Number of preceding messages included as context; 0 disables (env: OPENAI_HISTORY_SIZE)

    Number of preceding messages included as context; 0 disables (env: OPENAI_HISTORY_SIZE)

  • --openai.max-symbols-request16000Maximum symbols in the OpenAI request, fallback if tokenizer fails (env: OPENAI_MAX_SYMBOLS_REQUEST)

    Maximum symbols in the OpenAI request, fallback if tokenizer fails (env: OPENAI_MAX_SYMBOLS_REQUEST)

  • --openai.max-tokens-request2048Maximum tokens in the OpenAI request (env: OPENAI_MAX_TOKENS_REQUEST)

    Maximum tokens in the OpenAI request (env: OPENAI_MAX_TOKENS_REQUEST)

  • --openai.max-tokens-response1024Maximum tokens in the OpenAI response (env: OPENAI_MAX_TOKENS_RESPONSE)

    Maximum tokens in the OpenAI response (env: OPENAI_MAX_TOKENS_RESPONSE)

  • --openai.modelgpt-4o-miniOpenAI model name (env: OPENAI_MODEL)

    OpenAI model name (env: OPENAI_MODEL)

  • --openai.promptOpenAI system prompt; builtin default is used when empty (env: OPENAI_PROMPT)

    OpenAI system prompt; builtin default is used when empty (env: OPENAI_PROMPT)

  • --openai.reasoning-effortnoneReasoning effort for thinking models; none leaves the model default, off disables thinking (env: OPENAI_REASONING_EFFORT)

    Reasoning effort for thinking models; none leaves the model default, off disables thinking (env: OPENAI_REASONING_EFFORT)

    values: none | off | low | medium | high

  • --openai.retry-count1OpenAI retry count (env: OPENAI_RETRY_COUNT)

    OpenAI retry count (env: OPENAI_RETRY_COUNT)

  • --openai.tokenOpenAI API token; integration disabled if not set (env: OPENAI_TOKEN)

    OpenAI API token; integration disabled if not set (env: OPENAI_TOKEN)

  • --openai.vetoVeto mode: OpenAI is contacted only for spam detected by other checks and must confirm (env: OPENAI_VETO)

    Veto mode: OpenAI is contacted only for spam detected by other checks and must confirm (env: OPENAI_VETO)

    values: true/false

  • --paranoidCheck all messages for spam, not only the first ones (env: PARANOID)

    Check all messages for spam, not only the first ones (env: PARANOID)

    values: true/false

  • --prohibited-langsComma-separated prohibited languages or scripts (env: PROHIBITED_LANGS)

    Comma-separated prohibited languages or scripts (env: PROHIBITED_LANGS)

    values: e.g. chinese,cyrillic; empty disables

  • --prohibited-langs-min3Minimum prohibited-script letters in a message to consider it spam (env: PROHIBITED_LANGS_MIN)

    Minimum prohibited-script letters in a message to consider it spam (env: PROHIBITED_LANGS_MIN)

  • --reactions.max-reactions0Max reactions per user in window to trigger a spam ban; 0 disables (env: REACTIONS_MAX_REACTIONS)

    Max reactions per user in window to trigger a spam ban; 0 disables (env: REACTIONS_MAX_REACTIONS)

  • --reactions.window1hTime window for reaction spam detection (env: REACTIONS_WINDOW)

    Time window for reaction spam detection (env: REACTIONS_WINDOW)

  • --report.auto-ban-thresholdAuto-ban after N reports; 0 disables, must be >= threshold (env: REPORT_AUTO_BAN_THRESHOLD)

    Auto-ban after N reports; 0 disables, must be >= threshold (env: REPORT_AUTO_BAN_THRESHOLD)

  • --report.enabledEnable user spam reporting (env: REPORT_ENABLED)

    Enable user spam reporting (env: REPORT_ENABLED)

    values: true/false

  • --report.rate-limit10Maximum reports per user per period (env: REPORT_RATE_LIMIT)

    Maximum reports per user per period (env: REPORT_RATE_LIMIT)

  • --report.rate-period1hRate limit time period for reports (env: REPORT_RATE_PERIOD)

    Rate limit time period for reports (env: REPORT_RATE_PERIOD)

  • --report.threshold2Number of reports that triggers an admin notification (env: REPORT_THRESHOLD)

    Number of reports that triggers an admin notification (env: REPORT_THRESHOLD)

  • --server.authautoBasic auth password for the server; empty string disables protection (env: SERVER_AUTH)

    Basic auth password for the server; empty string disables protection (env: SERVER_AUTH)

  • --server.auth-hashBcrypt hash of the basic auth password, takes precedence over --server.auth (env: SERVER_AUTH_HASH)

    Bcrypt hash of the basic auth password, takes precedence over --server.auth (env: SERVER_AUTH_HASH)

  • --server.enabledEnable the webapi server and WEB UI (env: SERVER_ENABLED)

    Enable the webapi server and WEB UI (env: SERVER_ENABLED)

    values: true/false

  • --server.listen:8080Listen address of the webapi server (env: SERVER_LISTEN)

    Listen address of the webapi server (env: SERVER_LISTEN)

  • --similarity-threshold0.5Similarity to known spam samples above which a message is spam; 1 disables the check (env: SIMILARITY_THRESHOLD)

    Similarity to known spam samples above which a message is spam; 1 disables the check (env: SIMILARITY_THRESHOLD)

  • --soft-banRestrict user actions instead of banning (env: SOFT_BAN)

    Restrict user actions instead of banning (env: SOFT_BAN)

    values: true/false

  • --space.enabledEnable abnormal words/spacing check (env: SPACE_ENABLED)

    Enable abnormal words/spacing check (env: SPACE_ENABLED)

    values: true/false

  • --space.min-words5Minimum number of words in the message to check (env: SPACE_MIN_WORDS)

    Minimum number of words in the message to check (env: SPACE_MIN_WORDS)

  • --space.ratio0.3Ratio of spaces to all characters in the message (env: SPACE_RATIO)

    Ratio of spaces to all characters in the message (env: SPACE_RATIO)

  • --space.short-ratio0.7Ratio of short words to all words in the message (env: SPACE_SHORT_RATIO)

    Ratio of short words to all words in the message (env: SPACE_SHORT_RATIO)

  • --space.short-word3Word length considered short (env: SPACE_SHORT_WORD)

    Word length considered short (env: SPACE_SHORT_WORD)

  • --storage-timeout0sStorage timeout (env: STORAGE_TIMEOUT)

    Storage timeout (env: STORAGE_TIMEOUT)

  • --superPrivileged users, immune to spam detection and able to unban others; repeatable or comma-separated (env: SUPER_USER)

    Privileged users, immune to spam detection and able to unban others; repeatable or comma-separated (env: SUPER_USER)

  • --suppress-join-messageDelete the join message when a kicked user is removed (env: SUPPRESS_JOIN_MESSAGE)

    Delete the join message when a kicked user is removed (env: SUPPRESS_JOIN_MESSAGE)

    values: true/false

  • --telegram.groupGroup name or id to monitor, mandatory; public groups use a name, private groups an id like -123456789 (env: TELEGRAM_GROUP)

    Group name or id to monitor, mandatory; public groups use a name, private groups an id like -123456789 (env: TELEGRAM_GROUP)

  • --telegram.idle30sIdle duration for long polling (env: TELEGRAM_IDLE)

    Idle duration for long polling (env: TELEGRAM_IDLE)

  • --telegram.timeout30sHTTP client timeout for Telegram (env: TELEGRAM_TIMEOUT)

    HTTP client timeout for Telegram (env: TELEGRAM_TIMEOUT)

  • --telegram.tokenTelegram bot token, mandatory (env: TELEGRAM_TOKEN)

    Telegram bot token, mandatory (env: TELEGRAM_TOKEN)

  • --testing-idExtra chat ids the bot will listen to, for debugging only (env: TESTING_ID)

    Extra chat ids the bot will listen to, for debugging only (env: TESTING_ID)

  • --tg-dbgTelegram library debug mode (env: TG_DEBUG)

    Telegram library debug mode (env: TG_DEBUG)

    values: true/false

  • --trainingTraining mode, passive spam detection without bans or deletions (env: TRAINING)

    Training mode, passive spam detection without bans or deletions (env: TRAINING)

    values: true/false

  • --warn.threshold0Auto-ban after N warns within the window; 0 disables (env: WARN_THRESHOLD)

    Auto-ban after N warns within the window; 0 disables (env: WARN_THRESHOLD)

  • --warn.window720hSliding window for counting warns (env: WARN_WINDOW)

    Sliding window for counting warns (env: WARN_WINDOW)

    values: capped at 8760h

tg-spam releases & version history

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…