Telegram group bot that assigns funny context-aware member tags with Kimi K2.6 Turbo via F https://t.me/tag_smart_bot
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nikita Kolmogorov 4ee91fc69c
Upgrade Bun to 1.4.4 (Oct 2026 security fixes) (#2)
Nixpacks gets Bun from nixpkgs, which only has 1.3.13 at our pin, so the setup phase points nixpkgs' bun package at the official 1.4.4 release zip (hash pinned). Remove the override once nixpkgs has bun >= 1.4.4.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:10:58 -07:00
.github Add funding links 2026-10-08 15:24:48 -07:00
assets Add BotFather avatar asset 2026-05-27 20:19:55 -07:00
src Handle tag model provider failures safely (#1) 2026-09-22 10:53:41 -07:00
tests Handle tag model provider failures safely (#1) 2026-09-22 10:53:41 -07:00
.env.example Support OpenRouter model fallbacks 2026-06-26 08:27:51 -07:00
.gitignore Initial Telegram member tag bot 2026-05-27 18:44:00 -07:00
bun.lockb Initial Telegram member tag bot 2026-05-27 18:44:00 -07:00
nixpacks.toml Upgrade Bun to 1.4.4 (Oct 2026 security fixes) (#2) 2026-10-22 10:10:58 -07:00
package.json Support OpenRouter model fallbacks 2026-06-26 08:27:51 -07:00
README.md Support OpenRouter model fallbacks 2026-06-26 08:27:51 -07:00
tsconfig.json Initial Telegram member tag bot 2026-05-27 18:44:00 -07:00

Tag Smart Bot

Telegram group bot that watches group chat messages and periodically asks an OpenAI-compatible LLM provider to assign funny context-aware member tags.

Bot: @tag_smart_bot

What It Does

  • Stores message context separately per Telegram group.
  • Recalculates tags automatically every ~100 text messages by default.
  • Uses OpenRouter free models, with fallback across configured models, for context-aware tag suggestions.
  • Matches tag language and script to the chat's dominant language.
  • Updates Telegram member tags through the Bot API when the bot has admin rights.

Telegram Setup

This is the same setup shown by /start and /help in the bot.

  1. Add the bot to a group.
  2. Promote it to admin with the right to change member tags.
  3. Send /start, /help, or /retag in the group to verify setup.

Messages and tags never mix between groups.

Environment

Copy .env.example to .env locally, or set these variables in Easypanel:

  • TELEGRAM_BOT_TOKEN
  • LLM_API_KEY
  • LLM_BASE_URL
  • LLM_MODEL or comma-separated LLM_MODELS
  • DATABASE_PATH
  • MESSAGES_PER_RETAG
  • MAX_CONTEXT_MESSAGES
  • MAX_TAG_CHANGES_PER_RUN
  • TAG_MAX_LENGTH

Keep DATABASE_PATH on a persistent Easypanel volume, for example /app/data/member-tags.sqlite.

Legacy FIREWORKS_API_KEY, FIREWORKS_BASE_URL, FIREWORKS_MODEL, and comma-separated FIREWORKS_MODELS are still supported for existing deployments.

Development

bun install
bun test
bun run typecheck
bun run start

Deployment

Use Nixpacks on Hetzner Easypanel. Set the env vars above in Easypanel and mount a persistent data volume at /app/data.