Buzzing is a Telegram notification system that helps you manage and send important notifications through multiple bots. Built with asyncio for efficient concurrent operations.
- Multiple bot management
- Asynchronous message handling
- SQLite persistence
- Graceful shutdown handling
- Configurable notification rules
- Python 3.9 or higher
- pip (Python package installer)
- Linux/Unix environment
- System Dependencies
sudo apt-get update && sudo apt-get install -y python3-pip python3-venv
- Install Poetry
# Using apt (recommended)
sudo apt install -y python3-poetry
# OR using pipx
sudo apt install -y pipx && pipx ensurepath && pipx install poetry
- Install Project Dependencies
poetry install
- Start the Application
poetry run python -m buzzing.driver
- Clone the Repository
git clone https://github.com/mehtasankets/buzzing.git
cd buzzing
- Configure VSCode
- Install recommended extensions
- Set Python interpreter:
poetry env info --path # Copy this path # In VSCode: Ctrl+Shift+P > Python: Select Interpreter > Enter path
Via Command Line:
poetry run pytest
Via VSCode:
- Open Testing sidebar (flask icon)
- Click play button to run all tests
- Individual tests can be run with their respective play buttons
Start:
poetry run python -m buzzing.driver
Stop:
- Press
Ctrl+C
in the terminal, or - Run:
pkill -SIGINT -f "python -m buzzing.driver"
Application logs are written to buzzing.log
. Monitor in real-time:
tail -f buzzing.log
The application uses SQLite for configuration storage. The database schema is defined in etc/db_config/v0.sql
.
Bots are configured in the bots_config
table:
CREATE TABLE bots_config(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT, -- Bot name
description TEXT, -- Bot description
token TEXT, -- Telegram bot token
password TEXT, -- Bot password
entry_module TEXT, -- Python module containing bot implementation
entry_class TEXT, -- Python class name for the bot
metadata TEXT, -- Additional JSON configuration
is_active BOOLEAN -- Bot active status
);
User subscriptions are managed in the subscription
table:
CREATE TABLE subscription(
user_id INTEGER, -- Telegram user ID
username TEXT, -- Telegram username
bot_id INTEGER, -- Reference to bots_config.id
is_active BOOLEAN, -- Subscription status
PRIMARY KEY (user_id, bot_id)
);
The database is automatically initialized with test bots when you first run the application.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- python-telegram-bot for the excellent Telegram API wrapper