A Telegram bot to tag everyone in a group
Try It Now
·
Report Bug
·
Request Feature
Note
A new version is on the way! Complete rewrite of the codebase with new features and improvements. Stay tuned! Donate to support the development and keep the bot online: Ko-fi or Buy me a coffee
This bot allows you to mention all users in a group. Users who wish to receive these notifications will have to sign up using the /in command.
NEW: Now all new users will be automatically added to the list when they join the group.
You can use the public bot on Telegram: @TagEveryone_TheBot
News channel: https://t.me/tageveryone_news
Note
The public bot is hosted on my server, so it may be slow or not available. You can host the bot yourself or use the Docker image. Consider supporting me on Ko-fi or Buy me a coffee to keep the bot online.
- Add the bot to your group
- Give the bot the permission to read messages and send messages (admin)
- Use the
/incommand to add yourself to the list - Use the
/everyonecommand to mention all users in the list
@everyoneor@alltrigger/everyonecommand. (like Discord)- The user decides whether to subscribe to the list with
/in - The user decides whether to exit to the list with
/out - NEW: Manually remove/add users to the list with
/in @usernameor/out @username(beta, only if the username is in the db and updated) - NEW: Webhook mode support
- Telegram WebApp support
- All is saved to SQLite3 database
- Hosted or self-hosted
- Docker support
- NEW: Sentry error tracking support
/in- Add yourself to the Everyone's list/out- Remove yourself from the Everyone's list/everyone- Send a message to all in the list/all- Send a message to all in the list/help- Show help message/status- Show the bot status and uptime/stats- NEW, Show the bot stats/announce text- NEW, Send a message to all groups/list- Show the Everyone's list without mention
Instead of the command /everyone or /all, you can use @everyone or @all
- REST API
- WebApp
- Ignore tag requests if time enlapsed is > 2min
- Automatically add all members' group to Everyone's list
- Welcome message when the bot is added to a group
- Tag members only with user id (not username)
- Remove user from list when reply_to message
- MySQL support
| Variable | Description | Default |
|---|---|---|
| token | Telegram Bot Token | - |
| owner_id | Telegram User ID | - |
| enable_webapp_server | Enable the WebApp server | True |
| webserver_debug | Enable Flask debug | False |
| report_errors_owner | Report errors to the owner | False |
| secret_key | Flask secret key. Generate a random | - |
| sentry_dsn | Sentry DSN for error tracking | - |
| webhook_mode | Enable Telegram webhook mode | False |
| webhook_listen_address | IP-Address to listen on for webhook mode | 127.0.0.1 |
| webhook_port | Port to listen on for webhook mode | 80 |
| webhook_url_path | Path inside url for webhook mode | '' |
| webhook_url_base | Explicitly specify the webhook url for webhook mode | None |
| webhook_ssl_cert_path | SSL certificate path for webhook mode | None |
| webhook_ssl_key_path | SSL key path for webhook mode | None |
| webhook_secret_token | A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request for webhook mode | None |
| APP_HOST | Flask host | localhost/0.0.0.0 |
| APP_PORT | Flask port | 5000 |
docker build -t tageveryone_telegrambot .Create a docker-compose.yml file with the following content:
version: '3'
services:
tageveryone_telegrambot:
image: matt0550/tageveryone_telegrambot # or the image name you used
user: 1001:1001
environment:
- token=BOT_TOKEN
- owner_id=OWNER_ID
- enable_webapp_server=True
- webserver_debug=False
- report_errors_owner=False
- sentry_dsn=SECRET_SENTRY_DSN
- secret_key=SECRET_KEY
- webhook_mode=True
- webhook_url_base=https://your-webhook-url/
- webhook_port=443
volumes:
- /path/to/database-new.db:/src/db/database-new.db
ports:
- 5000:5000
- 443:443
restart: unless-stoppedRun the container with docker-compose up -d
docker run -d \
-e token=TG_BOT_TOKEN \
-e owner_id=TG_OWNER_ID \
-e enable_webapp_server=True \
-e webserver_debug=False \
-e report_errors_owner=False \
-e sentry_dsn=SECRET_SENTRY_DSN \
-e secret_key=SECRET_KEY \
-e webhook_mode=True \
-e webhook_url_base=https://your-webhook-url/ \
-e webhook_port=443 \
-v /path/to/database-new.db:/src/db/database-new.db \
-p 5000:5000 \
--name tageveryone_telegrambot \
matt0550/tageveryone_telegrambotClone the project
git clone https://github.com/Matt0550/TagEveryoneTelegramBotGo to the project directory
cd TagEveryoneTelegramBot-masterInstall dependencies
pip install -r requirements.txtSet the environment variables copying the .env.example file to .env and filling the values
cp .env.example .envStart the bot (after setting the environment variables)
python ./src/main.pyIf you want to enable the WebApp, you have to set the enable_webapp_server environment variable to True.
The WebApp is available at http://<ip>:<port> by default.
To show the WebApp on the Telegram bot, you have to setup a reverse proxy to the WebApp. You can use Nginx or Caddy. Then configure the webapp URL in the bot settings in the Telegram BotFather.
To enable the Webhook mode, you have to set the webhook_mode environment variable to True and configure the webhook settings (webhook_url_base, webhook_port, webhook_url_path, webhook_ssl_cert_path, webhook_ssl_key_path, webhook_secret_token) according to your needs. Then you have to set the webhook URL in the Telegram Bot. To do this, you can use the following URL:
POST https://api.telegram.org/bot<token>/setWebhook?url=<webhook_url_base><webhook_url_path>&secret_token=<webhook_secret_token>
You can contact me on:
Discord: https://matt05.it/discord
Telegram: https://matt05.it/telegram
Mail: mail@matteosillitti.com

