Skip to content

Telegram bot removing group chat messages after specified period of time

Notifications You must be signed in to change notification settings

quasiyoke/comrade-colonel-bot

Repository files navigation

Comrade Colonel Bot

Build Status

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

To try it quickly, run:

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 manageable chat message lifetime is 48 hours (172800 seconds).

Deployment

  1. Install Docker Compose,

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

    echo -n '123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11' > ./telegram-bot-token
  3. Fetch bot's deployment configuration file and run the bot:

    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.

About

Telegram bot removing group chat messages after specified period of time

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published