Chat control bot for telegram
Bot helps protect your telegram group chat from simple bots. Bot prohibits a new user from write messages and read history until the user confirms that they are not a bot.
It sends a message to group chat to confirm that the user is not a bot. The user will be removed from group chat if they does not confirm that they is not a bot within 24 hours.
A confirmation message will also be deleted from group chat if it was successfully confirmed or after user was deleted by inactivity.
Installation
Get a bot token by chatting with BotFather.
And you need to have MongoDB to store chat and some users data.
Manual
git clone https://github.com/sattellite/github.com/sattellite/tg-group-control-bot.git
cd tg-group-control-bot
go get -v -d ./...
go build -o group-control-bot cmd/grcbot/main.go
BOT_TOKEN=xxx MONGO_URL="mongodb://<user>:<password>@<host>:<port>/chat_control" ./group-control-bot
If you will copy binary file to other location then you need copy
locales
directory too.
Docker
git clone https://github.com/sattellite/github.com/sattellite/tg-group-control-bot.git
cd tg-group-control-bot
- Create
.env
file in root of project docker-compose up -d --build
.env
file for docker-compose
cat > .env <<EOC
BOT_TOKEN=123456:abcdef123456
ROOT_USER=mongo_admin_user
ROOT_PASS=mongo_admin_password
BOT_USER=mongo_db_user
BOT_PASS=mongo_db_password
EOC