A Telegram bot designed to facilitate user onboarding through interactive conversations.
- Interactive conversations with users
- Dynamic learning capabilities
- User management system
- Export functionality for conversation data
- Topic-based chat organization
Commands that should be used in the main/general chat:
/attach
- Set up the bot for this supergroup if not already configured/detach
- Remove the bot from this supergroup/set_manager @manager
- Set the default manager for all new users/export
- Generate a PDF report of all unfinished users' conversations
Commands that should be used within topic chats:
/set_manager @manager
- Assign a specific manager to the user in this topic/learn <instructions>
- Teach the bot new information- Use directly:
/learn <instructions>
to add new instructions - Reply to a message:
/learn <instructions>
to learn from both the instructions and the message
- Use directly:
/instructions
- View current bot instructions/forget
- Clear all learned instructions/stop
- End the conversation with the current user
- Clone the repository:
git clone https://github.com/yourusername/indusgpt_dev.git
cd indusgpt_dev
- Install required packages:
uv sync
- Clone the repository:
git clone https://github.com/yourusername/indusgpt.git
cd indusgpt
-
Set up environment variables in
.env.example
-
Build the Docker image:
./run.sh
- View logs:
docker logs -f indusgpt-bot-1
- Stop the bot:
docker stop indusgpt-bot-1
The bot can be configured using the following environment variables:
Variable | Description | Default |
---|---|---|
TELEGRAM_BOT_TOKEN |
Telegram Bot API token (required) | - |
OPENAI_API_KEY |
OpenAI API key (required) | - |
MODEL |
OpenAI model to use | gpt-4.1-2025-04-14 |
DATABASE_URL |
Database connection URL | sqlite://db.sqlite3 |
OPENAI_API_BASE_URL |
OpenAI API base URL | https://api.openai.com/v1 |
LOG_FILE |
Log file path | bot.log |
GOOGLE_CREDENTIALS_PATH |
Path to Google service account credentials (required) | - |
GOOGLE_SHEET_URL |
Google Sheet URL for user information (required) | - |
GOOGLE_SHEET_WORKSHEET_NAME |
Name of the worksheet in Google Sheet | UserInfo |
# Set required environment variables
export TELEGRAM_BOT_TOKEN="your_telegram_bot_token"
export OPENAI_API_KEY="your_openai_api_key"
export GOOGLE_CREDENTIALS_PATH="path_to_credentials"
export GOOGLE_SHEET_URL="your_sheet_url"
# Optional: configure other variables as needed
uv run main.py
docker start indusgpt
The bot uses:
- aiogram for Telegram bot functionality
- FPDF2 for PDF report generation
- SQLite with Tortoise ORM for data persistence
- Topic groups for organized conversation management
For developers: The codebase follows a modular structure with separate handlers for supergroup commands, chat flow, and user interactions.