Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 941 Bytes

File metadata and controls

46 lines (36 loc) · 941 Bytes

Lightweight Python Telegram bot for LLM chatting with user separation and multiple session support

  • bot.py
  • requirements.txt
  • .env.example

What it supports:

  • LLM chat over Telegram
  • Separate session lists per Telegram user
  • Independent message history per session
  • Session switching
  • Session creation
  • Session renaming
  • Current session lookup

Commands:

  • /start
  • /help
  • /new [name]
  • /sessions
  • /use <session_id>
  • /rename <session_id>
  • /current

Implementation notes:

  • Uses sqlite3 for lightweight persistence
  • Stores:
    • users
    • sessions
    • messages
  • Uses an OpenAI-compatible backend via env vars:
    • TELEGRAM_BOT_TOKEN
    • OPENAI_API_KEY
    • OPENAI_MODEL
    • optional OPENAI_BASE_URL

Run steps:

  1. Install deps: pip install -r requirements.txt
  2. Copy env template and fill values: cp .env.example .env
  3. Start bot: python3 bot.py

Made by Codex, GPT-5.4