Telegram bot that automatically deletes messages containing blacklisted terms.
- Find and add the
P0lizeiBot
to your Telegram group chat (like adding a regular user) - Edit the group chat and add
P0lizeiBot
as administrator. This gives the bot access to deleting messages. - Test the bot by writing messages containing blacklisted terms. Such messages should be auto-deleted.
To check the blacklist send the following message in the group chat:
/blacklist
Prerequisites
- Node & NPM LTS
Create a .env
file on the top project folder level with the following content:
TELEGRAM_TOKEN=<your telegram token>
BLACKLIST=<your comma-separated list of keywords>
Prerequisites
- Docker
- Telegram bot token (Telegram bot should have been created in advance through BotFather)
Build and run using Docker
- Retrieve the bot's Telegram token through the BotFather
- Build and run a docker container
# Build the docker image
$ docker build -t polizeibot .
# Run a container
$ docker run -d \
--name polizeibot \
--restart unless-stopped \
-e TELEGRAM_TOKEN=<YOUR TOKEN> \
-e BLACKLIST=badword,otherbadword \
polizeibot