Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/quasiyoke/comrade-colonel-bot

Telegram bot removing group chat messages after specified period of time
https://github.com/quasiyoke/comrade-colonel-bot

chatbot privacy telegram

Last synced: 2 months ago
JSON representation

Telegram bot removing group chat messages after specified period of time

Awesome Lists containing this project

README

        

# Comrade Colonel Bot

[![Build Status](https://travis-ci.com/quasiyoke/comrade-colonel-bot.svg?branch=master)](https://travis-ci.com/quasiyoke/comrade-colonel-bot)

Telegram bot removing group chat messages after specified period of time.

To try it quickly, run:

```sh
export TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
export STORAGE_PATH=/var/lib/comrade-colonel-bot/db.sqlite3
export MESSAGE_LIFETIME=5s
export DELETION_PERIOD=1s
cargo run
```

Don't forget to specify your actual Telegram bot token (you're able to get one from `@BotFather`). The bot will be configured to delete all messages he has evidenced after 5 seconds. [Maximal possible](https://core.telegram.org/bots/api#deletemessage) manageable chat message lifetime is 48 hours (172800 seconds).

## Deployment

1. Install [Docker Compose](https://docs.docker.com/compose/install/),

1. Create a file with Telegram bot token to put it into Docker Secrets' store:

```sh
echo -n '123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11' > ./telegram-bot-token
```

1. Fetch bot's deployment configuration file and run the bot:

```sh
wget https://raw.githubusercontent.com/quasiyoke/comrade-colonel-bot/master/docker-compose.yml
docker-compose up
```

Default configuration assumes chat messages lifetime of 42 hours.