simple, but useful telegram bot to gather all of group members attention!
Contents
Getting started
Requirements
docker-compose
in version1.25.0
docker
in version20.10.7
Installation
git clone https://github.com/miloszowi/everyone-mention-telegram-bot.git
after that, you need to copy env files and fulfill it with correct values
cp .env.local .env
cp docker/config/app.dist.env docker/config/app.env
cp docker/config/database.dist.env docker/config/app.env
and finally, you can run the bot by launching docker containers
docker-compose up -d
(-d
flag will run containers in detached mode)
Logs
You can use
docker/logs <container>
to check container logs
Env files
.env
MONGODB_INTERNAL_PORT
- Mongodb internal port (should be the same as declared inapp.env
)APP_INTERNAL_PORT
- App internal port (should be the same as declared inapp.env
)APP_EXPOSED_PORT
- App exposed port (if you are not using any reverse proxy it should be also the same as declared inapp.env
)
app.env
BOT_TOKEN
- your telegram bot token from BotFatherWEBHOOK_URL
- url for telegram webhooks (withour the bot token)PORT
- port used for initializing webhook & appMONGODB_DATABASE
- MongoDB database nameMONGODB_USERNAME
- MongoDB usernameMONGODB_PASSWORD
- MongoDB passwordMONGODB_HOSTNAME
- MongoDB host (defaultdatabase
- container name)MONGODB_PORT
- MongoDB port (default27017
- given in docker-compose configuration)
database.env
MONGO_INITDB_ROOT_USERNAME
- conf fromapp.env
MONGO_INITDB_ROOT_PASSWORD
- conf fromapp.env
MONGO_INITDB_DATABASE
- conf fromapp.env
MONGODB_DATA_DIR
- directory to store MongoDB documents (inside a container)MONDODB_LOG_DIR
- path to logs storage
Commands
/in
/in <group_name>
(blank group_name
will assign you to default
group)
Will sign you in for everyone-mentions.
If you have already opted-in before, alternative reply will be displayed.
/out
/out <group_name>
Will sign you off for everyone-mentions.
If you haven't opted-in before, alternative reply will be displayed.
/everyone
/everyone <group_id>
Will mention everyone that opted-in for everyone-mentions separated by spaces.
If user does not have nickname, it will first try to assign his firstname, then random firstname from names
python library
If there are no users that opted-in for mentioning, alternative reply will be displayed.
/groups
Will display available groups for this chat as well with members count that opted-in for specific group
/silent
/silent <group_name>
Will display all users that opted-in but without notyfing them.