From c93da69281f7884e86e3bbb11e12fcb2f07e55b2 Mon Sep 17 00:00:00 2001 From: difome Date: Wed, 28 Jan 2026 04:48:22 +0200 Subject: [PATCH] update .env.example and README with additional bot configuration options --- .env.example | 41 ++++++++++++++++++++++++++++++++++++----- README.md | 5 ++++- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 2b539f3..4afd715 100644 --- a/.env.example +++ b/.env.example @@ -2,25 +2,56 @@ # TELEGRAM BOT CONFIGURATION # ============================================ -# Telegram Bot Token (Required) +# Telegram Bot Token # Get it from BotFather: https://t.me/botfather BOT_TOKEN=your_bot_token_here -# Creator ID (Required) +# Creator ID # Your Telegram user ID - the bot will recognize you as creator CREATOR_ID=your_user_id_here # ============================================ -# OPTIONAL: AI MODELS +# BOT SETTINGS (Optional) +# ============================================ + +# Bot Prefix for commands +BOT_PREFIX= + +# Whitelist of chat IDs (comma-separated) +# Example: 123456789,987654321 +CHAT_IDS_WHITELIST= + +# Test environment mode +TEST_ENVIRONMENT=false + +# Docker deployment +IS_DOCKER=false + +# Only creator can use bot +ONLY_FOR_CREATOR_MODE=false + +# Use user names in AI prompts +USE_NAMES_IN_PROMPT=true + +# Maximum photo size in pixels +MAX_PHOTO_SIZE=1280 + +# ============================================ +# AI MODELS CONFIGURATION (Optional) # ============================================ # Google Gemini GEMINI_API_KEY= +GEMINI_MODEL=gemini-2.5-flash # Mistral AI MISTRAL_API_KEY= +MISTRAL_MODEL=mistral-small-latest -# Ollama (Local) +# Ollama (Local AI Model) OLLAMA_ADDRESS= OLLAMA_MODEL= -SYSTEM_PROMPT= +OLLAMA_API_KEY= + +# Custom system prompt for AI +SYSTEM_PROMPT= \ No newline at end of file diff --git a/README.md b/README.md index 230d7f3..c4e462a 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ # Telegram Chat Bot +Bot for Telegram with a lot of commands and AI (Ollama/Gemini/Mistral) written in TypeScript + NodeJS/Bun runtime + Drizzle ORM (SQLite DB) ## Quick Start ```bash cp .env.example .env -# Edit .env: add BOT_TOKEN and CREATOR_ID or +# Edit .env: add BOT_TOKEN, CREATOR_ID and configure optional AI models (GEMINI_API_KEY, MISTRAL_API_KEY, OLLAMA_ADDRESS) ``` **With Bun (Recommended):** @@ -24,12 +25,14 @@ npm run build && npm start **With Docker:** ```bash +# Set IS_DOCKER=true in .env docker build -f Dockerfile -t tg-bot . docker run -d --env-file .env -v $(pwd)/data:/config/data tg-bot ``` **With Docker (Bun):** ```bash +# Set IS_DOCKER=true in .env docker build -f Dockerfile-bun -t tg-bot-bun . docker run -d --env-file .env -v $(pwd)/data:/config/data tg-bot-bun ```