A sophisticated Telegram bot powered by advanced language models that provides intelligent text processing, content analysis, and information retrieval capabilities. The bot supports multiple features including text polishing, summarization, translation, and financial data retrieval.
- Text Polishing: Enhance and refine text while maintaining its original meaning
- Summarization: Generate concise summaries of text content and web pages
- Translation: Translate text between different languages
- Financial Data: Retrieve stock market information and financial data
- Content Processing: Handle various content types including HTML, PDF, and YouTube transcripts
- Error Handling: Robust error management and user-friendly feedback
- Access Control: Whitelist-based user authentication for security
Create a .env
file in the root directory of your project and add the following variables:
BOT_TOKEN=your_telegram_bot_token
BOT_WHITELIST=comma_separated_user_ids
MODEL=gpt-4o-mini
OPENAI_API_KEY=your_openai_api_key
SINGLEFILE_PATH=your_singlefile_path
# Install uv
pip install uv
# Install project dependencies
uv sync
npm install "single-file-cli"
Start the bot using uv:
uv run bot
/help
- Display available commands and usage information/polish
- Improve and refine text while preserving its meaning/summarize
- Generate a concise summary of provided text or URL content/translate
- Translate text to a specified language/ticker
- Retrieve financial data for a given stock symbol
src/
├── bot/
│ ├── bot/ # Core bot functionality
│ ├── loaders/ # Content loaders (HTML, PDF, YouTube)
│ ├── tools/ # Feature implementations
│ ├── cli.py # Command-line interface
│ ├── llm.py # Language model integration
│ └── utils.py # Utility functions
tests/ # Test suite
- Install pre-commit hooks:
pre-commit install
- Follow code style guidelines:
- Use type hints
- Write docstrings for functions and classes
- Follow PEP 8 guidelines
- Create feature branches for new development:
git checkout -b feature/your-feature-name
Run the test suite:
uv run pytest -v -s tests
Run tests with coverage:
uv run pytest -v -s --cov=src tests
This project is licensed under the MIT License - see the LICENSE file for details.