https://github.com/nacbots/broadcastbot
A simple Telegram bot that can broadcast messages and media to the bot subscribers. with mongo DB support
https://github.com/nacbots/broadcastbot
bot broadcast broadcast-bot heroku heroku-app mongo mongodb nacbots pyrogram python-telegram-bot telegram telegram-bot
Last synced: 14 days ago
JSON representation
A simple Telegram bot that can broadcast messages and media to the bot subscribers. with mongo DB support
- Host: GitHub
- URL: https://github.com/nacbots/broadcastbot
- Owner: NACBots
- License: mit
- Created: 2021-09-08T14:15:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T14:42:43.000Z (about 1 month ago)
- Last Synced: 2025-04-06T07:06:00.218Z (21 days ago)
- Topics: bot, broadcast, broadcast-bot, heroku, heroku-app, mongo, mongodb, nacbots, pyrogram, python-telegram-bot, telegram, telegram-bot
- Language: Python
- Homepage: http://t.me/NACBots
- Size: 71.3 KB
- Stars: 104
- Watchers: 2
- Forks: 159
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Broadcast Bot v2
A simple Telegram bot that can broadcast messages and media to the bot subscribers using [MongoDB](https://mongodb.com).[](https://github.com/nacbots/broadcastbot&bg_color=#24292F)
## 🚀 What's New in v2?
- **15x Faster Broadcasts** – Implemented **semaphore**, making message delivery significantly faster!
- **Live Broadcast Status** – Real-time progress updates to track your broadcasts.
- **PyroBlack Migration** – Switched from **Pyrogram** to **PyroBlack** for improved performance and efficiency.
- **New Config Variables:**
- `MAX_CONCURRENT` – Maximum concurrent message sends (Default: 15, can be set up to 1000 for paid broadcasts).
- `UPDATE_INTERVAL` – Update interval in seconds to avoid flood waits (Default: 2).## Features
- Supports [MongoDB](https://mongodb.com) database 💁 for user records 📽.
- Users can choose whether to enable broadcast messages using `/settings` command.
- Logs new users in a specified channel.
- Get total user count from the database.
- Ban and unban users.## Required Configs
- `BOT_TOKEN` - Get from [@BotFather](https://t.me/BotFather)
- `API_ID` - Get it from [telegram.org](https://my.telegram.org/auth)
- `API_HASH` - Get it from [telegram.org](https://my.telegram.org/auth)
- `AUTH_USERS` - Authorized user IDs for [Admin Commands](https://github.com/nacbots/broadcastbot#admin-commands) (separated by spaces).
- `DB_URL` - MongoDB Database URI from [mongodb.com](https://mongodb.com)## Optional Configs
- `LOG_CHANNEL` - Channel ID to log new user notifications.
- `BROADCAST_AS_COPY` - Set to `True` for copy-forwarded messages, `False` for forwarded messages with a tag.
- `DB_NAME` - Collection name in MongoDB.
- `MAX_CONCURRENT` - Maximum concurrent message sends (Default: 15, can be set up to 2000).
- `UPDATE_INTERVAL` - Update interval in seconds to avoid flood waits (Default: 2).## User Commands 🤔
```
start - Start the bot 🥲
settings - Customize settings
```## Admin Commands 🤫
```
stats - Get total user count in the database
broadcast - Reply to a message to broadcast
ban_user - Ban a user with time & reason
unban_user - Unban a user
banned_users - Show banned users
```## Deploy 🚀
### Easiest Heroku Deploy 🤭
### Host Locally 🤕
```shell
git clone https://github.com/nacbots/BroadcastBot
cd BroadcastBot
pip3 install -r requirements.txt
# EDIT config.py values appropriately
python3 main.py
```## Support Group
## Found a Bug? 🐛
```Feel free to create a pull request or open an issue and describe your problem freely.```
## Credits
- [@NikhilEashy](https://github.com/nikhileashy)
- [@MrBotDeveloper](https://github.com/MrBotDeveloper)