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"/>
|
|
|
|
<!-- Icon made by https://www.freepik.com from https://www.flaticon.com/ -->
|
|
|
|
|
2021-09-25 16:49:11 +02:00
|
|
|
# Contents
|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-10-06 19:44:03 +02:00
|
|
|
* [Description](#description)
|
2021-09-18 15:30:56 +02:00
|
|
|
* [Getting started.](#getting-started)
|
|
|
|
* [Requirements](#requirements)
|
2021-09-25 16:49:11 +02:00
|
|
|
* [Installation](#installation)
|
|
|
|
* [Logs](#logs)
|
|
|
|
* [Env files](#env-files)
|
2021-09-18 15:30:56 +02:00
|
|
|
* [Commands](#commands)
|
2021-10-06 19:44:03 +02:00
|
|
|
* [`/join`](#join)
|
|
|
|
* [`/leave`](#leave)
|
2021-09-18 15:30:56 +02:00
|
|
|
* [`/everyone`](#everyone)
|
2021-09-28 21:47:17 +02:00
|
|
|
* [`/groups`](#groups)
|
2021-10-06 19:44:03 +02:00
|
|
|
* [`/start`](#start)
|
|
|
|
## Description
|
|
|
|
Everyone Mention Bot is simple, but useful telegram bot to gather group members attention.
|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-10-06 19:44:03 +02:00
|
|
|
You can create groups per chat to mention every user that joined the group by calling one command instead of mentioning them one by one.
|
2021-09-25 16:49:11 +02:00
|
|
|
|
2021-10-06 19:44:03 +02:00
|
|
|
## Getting started
|
2021-09-25 16:49:11 +02:00
|
|
|
### Requirements
|
|
|
|
- `docker-compose` in version `1.25.0`
|
|
|
|
- `docker` in version `20.10.7`
|
|
|
|
|
|
|
|
### Installation
|
2021-10-06 19:44:03 +02:00
|
|
|
- copy the repository
|
2021-09-18 15:30:56 +02:00
|
|
|
```bash
|
|
|
|
git clone https://github.com/miloszowi/everyone-mention-telegram-bot.git
|
|
|
|
```
|
2021-10-06 19:44:03 +02:00
|
|
|
- copy environment files and fulfill empty values
|
2021-09-18 15:30:56 +02:00
|
|
|
```bash
|
2021-10-04 18:19:26 +02:00
|
|
|
cp .env.local .env
|
2021-10-11 17:20:39 +02:00
|
|
|
cp docker/config/app.env.local docker/config/app.env
|
|
|
|
cp docker/config/database.env.local docker/config/app.env
|
2021-09-18 15:30:56 +02:00
|
|
|
```
|
2021-10-06 19:44:03 +02:00
|
|
|
- start the project (`-d` flag will run containers in detached mode)
|
2021-09-25 16:49:11 +02:00
|
|
|
```bash
|
|
|
|
docker-compose up -d
|
|
|
|
```
|
|
|
|
### Logs
|
|
|
|
```bash
|
|
|
|
docker/logs <container>
|
|
|
|
```
|
|
|
|
### Env files
|
2021-10-06 19:44:03 +02:00
|
|
|
- `.env`
|
|
|
|
- `MONGODB_INTERNAL_PORT` - Mongodb internal port (should be the same as declared in `app.env`)
|
|
|
|
- `APP_INTERNAL_PORT` - App internal port (should be the same as declared in `app.env`)
|
|
|
|
- `APP_EXPOSED_PORT` - App exposed port (if you are not using any reverse proxy it should be also the same as declared in `app.env`)
|
|
|
|
|
|
|
|
|
|
|
|
- `app.env`
|
|
|
|
- `BOT_TOKEN` - your telegram bot token from [BotFather](https://telegram.me/BotFather)
|
|
|
|
- `WEBHOOK_URL` - url for telegram webhooks (withour the bot token)
|
|
|
|
- `PORT` - port used for initializing webhook & app
|
|
|
|
- `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 `27017` - given in docker-compose configuration)
|
2021-10-08 15:25:47 +02:00
|
|
|
- `BANNED_USERS` - user ids separated by comma that are not allowed to use the bot
|
2021-10-06 19:44:03 +02:00
|
|
|
|
|
|
|
- `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` - path to logs storage
|
2021-09-25 16:49:11 +02:00
|
|
|
## Commands
|
2021-10-06 19:44:03 +02:00
|
|
|
### `/join`
|
2021-09-28 21:47:17 +02:00
|
|
|
```
|
2021-10-06 19:44:03 +02:00
|
|
|
/join <group_name>
|
2021-09-28 21:47:17 +02:00
|
|
|
```
|
2021-10-06 19:44:03 +02:00
|
|
|
Joins the group (and create if it did not exist before) given in message (`default` if not given)
|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-10-06 19:44:03 +02:00
|
|
|

|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-10-06 19:44:03 +02:00
|
|
|
### `/leave`
|
2021-09-28 21:47:17 +02:00
|
|
|
```
|
2021-10-06 19:44:03 +02:00
|
|
|
/leave <group_name>
|
2021-09-28 21:47:17 +02:00
|
|
|
```
|
|
|
|
|
2021-10-06 19:44:03 +02:00
|
|
|
Leaves the group given in message (`default` if not given)
|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-10-06 19:44:03 +02:00
|
|
|

|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-09-25 16:49:11 +02:00
|
|
|
### `/everyone`
|
2021-09-25 16:49:11 +02:00
|
|
|
```
|
2021-09-28 21:47:17 +02:00
|
|
|
/everyone <group_id>
|
2021-09-25 16:49:11 +02:00
|
|
|
```
|
2021-10-06 19:44:03 +02:00
|
|
|
Will mention every member of given group (`default` if not given).
|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-09-25 16:49:11 +02:00
|
|
|
If user does not have nickname, it will first try to assign his firstname, then random firstname from `names` python library
|
2021-09-18 15:30:56 +02:00
|
|
|
|
2021-10-06 19:44:03 +02:00
|
|
|

|
2021-09-28 21:47:17 +02:00
|
|
|
|
|
|
|
### `/groups`
|
2021-10-06 19:44:03 +02:00
|
|
|
Will display available groups for this chat as well with members count.
|
|
|
|
|
|
|
|

|
|
|
|
### `/start`
|
|
|
|
Start & Help message
|
|
|
|
|
|
|
|

|