2021-09-18 15:30:56 +02:00
|
|
|
# <p align="center"> [everyone-mention-telegram-bot](http://t.me/everyone_mention_bot)
|
|
|
|
<p align="center"> <img src="docs/logo.png" width="150"/>
|
|
|
|
<p align="center"> simple, but useful telegram bot to gather all of group members attention!
|
|
|
|
<!-- Icon made by https://www.freepik.com from https://www.flaticon.com/ -->
|
|
|
|
|
|
|
|
## Contents
|
|
|
|
|
|
|
|
* [Getting started.](#getting-started)
|
|
|
|
* [Installation](#installation)
|
|
|
|
* [Requirements](#requirements)
|
|
|
|
* [Env file](#env-file)
|
|
|
|
* [Commands](#commands)
|
|
|
|
* [`/in`](#in)
|
|
|
|
* [`/out`](#out)
|
|
|
|
* [`/everyone`](#everyone)
|
|
|
|
|
|
|
|
### Getting started
|
|
|
|
#### Installation
|
|
|
|
```bash
|
|
|
|
git clone https://github.com/miloszowi/everyone-mention-telegram-bot.git
|
|
|
|
pip install -r requirements.txt
|
|
|
|
python entrypoint.py
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Requirements
|
|
|
|
- `python` with version specified in `runtime.txt`
|
|
|
|
- `pip` with version `20.0.2`
|
|
|
|
|
2021-09-25 16:49:11 +02:00
|
|
|
#### Env files
|
|
|
|
First, copy env files for database and app containers
|
2021-09-18 15:30:56 +02:00
|
|
|
```bash
|
2021-09-25 16:49:11 +02:00
|
|
|
cp docker/config/app/app.dist.env docker/config/app/app.env
|
|
|
|
cp docker/config/database/database.dist.env docker/config/app/app.env
|
2021-09-18 15:30:56 +02:00
|
|
|
```
|
2021-09-25 16:49:11 +02:00
|
|
|
and then fulfill copied `.env` files with required values
|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-09-25 16:49:11 +02:00
|
|
|
app.env
|
|
|
|
- `bot_token` - your telegram bot token from [BotFather](https://telegram.me/BotFather)
|
|
|
|
- `MONGODB_DATABASE` - MongoDB database name
|
|
|
|
- `MONGODB_USERNAME` - MongoDB username
|
|
|
|
- `MONGODB_PASSWORD` - MongoDB password
|
|
|
|
- `MONGODB_HOSTNAME` - MongoDB host (default `database` - container name)
|
|
|
|
- `MONGODB_PORT` - MongoDB port (default `port` - given in docker-compose configuration)
|
|
|
|
|
|
|
|
database.env
|
|
|
|
- `MONGO_INITDB_ROOT_USERNAME` - conf from `app.env`
|
|
|
|
- `MONGO_INITDB_ROOT_PASSWORD` - conf from `app.env`
|
|
|
|
- `MONGO_INITDB_DATABASE` - conf from `app.env`
|
|
|
|
- `MONGODB_DATA_DIR` - directory to store MongoDB documents (inside a container)
|
|
|
|
- `MONDODB_LOG_DIR` - log file
|
2021-09-18 15:30:56 +02:00
|
|
|
### Commands
|
|
|
|
#### `/in`
|
|
|
|
Will sign you in for everyone-mentions.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
If you have already opted-in before, alternative reply will be displayed.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
#### `/out`
|
|
|
|
Will sign you off for everyone-mentions.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
If you haven't opted-in before, alternative reply will be displayed.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
#### `/everone`
|
|
|
|
Will mention everyone that opted-in for everyone-mentions separated by spaces.
|
|
|
|
|
2021-09-25 16:49:11 +02:00
|
|
|
If user does not have nickname, it will assign random name from `names` python library to his ID
|
2021-09-18 15:30:56 +02:00
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
If there are no users that opted-in for mentioning, alternative reply will be displayed.
|
|
|
|
|
|
|
|

|