A tiny, badass Telegram notifier/broadcast bot. Simple, reliable, and made for people who want stuff done — not fiddled with.
Dorf is a minimal Telegram bot that lets users subscribe/unsubscribe and lets the admin broadcast messages (or forward a replied message) to all subscribers. No fluff, no overengineering — just useful features and an easy local GUI for starting/stopping and creating DB backups.
/startwith inline buttons: Subscribe / Unsubscribe/subscribeand/unsubscribecommands- Admin-only
/broadcast(text or forward by replying) - Async SQLite (
aiosqlite) backend — small & portable gui.py(in main) — lightweight Tkinter controller for start/stop, logs, and DB backups- Docker-ready
- Clone repo:
git clone https://github.com/your-username/dorf-bot.git
cd dorf-bot- Create & activate virtualenv (recommended):
# Windows
python -m venv .venv
.venv\Scripts\activate
# Linux / macOS
python -m venv .venv
source .venv/bin/activate- Install requirements:
pip install -r requirements.txt-
Edit
config.py(see below) with your TOKEN and ADMIN_ID. Do not commit credentials to public git. -
Run:
python bot.py- (Optional) Start the GUI controller:
python main.pyIf you want Docker, make sure config.py has the correct values before building the image (do not commit them).
Build and run:
docker build -t dorf-bot .
docker run -d --name dorf-bot dorf-bot
# follow logs:
docker logs -f dorf-botTip: Keep
config.pyout of your git history (.gitignoreit) — or mount a safe file into the container at runtime.
This project expects config.py. To keep the README clean, populate config.py directly:
/start— welcome message with inline subscribe/unsubscribe buttons/subscribe— subscribe (same as button)/unsubscribe— unsubscribe (same as button)/broadcast <text>— admin-only: send<text>to all subscribersreplyto some message +/broadcast— forwards that message to all subscribers
Behavior: Bot stores subscribers in dorf_bot.db (SQLite). GUI shows subscriber count and can backup DB into backups_gui/.
main.py— main bot codedatabase.py— async SQLite wrapperconfig.py— setTOKENandADMIN_IDheregui.py(in main) — Tkinter controller for start/stop/logs/backupsDockerfile&.dockerignore— containerization
python-telegram-bot==20.5
aiosqlite==0.17.0
python-dotenv==0.21.0
TOKEN not setor auth errors → you forgot to editconfig.pyor used a wrong token. Fix it and restart the bot.- Bot doesn't send messages to some users → they may have blocked the bot or privacy settings prevent messages. Can't help Telegram drama.
- DB errors → check file permissions and that
dorf_bot.dbexists in the working directory. - Docker container crashes →
docker logs <container>is your friend. Check config values and working directory.
Want to add features? Nice.
- Fork, branch name
feature/your-thing - Keep code & comments in English
- Make small, testable commits
- Open PR with clear description & screenshots/GIF if helpful
Code style: clean, simple, readable. Tests welcome.
- Never commit secrets. Ever. Use a private repo, or better: mount a secrets file on the server.
- Backup DB regularly (GUI or cron/copy).
- If token leaks: regenerate it NOW. Don’t be lazy.
MIT — do whatever, just don’t pretend you wrote the whole thing if you forked it and added a typo.
Say which one you want and I’ll spit out the file right here. No drama, no waiting — do it now. 😎