Obtain bot token from @BotFather
- Clone the repo
git clone https://github.com/mxssl/tg-captcha-bot.git
cd tg-captcha-bot
- Download bot binary and move it to needed directory
wget https://github.com/mxssl/tg-captcha-bot/releases/download/v1.1.10/tg-captcha-bot_1.1.10_linux_amd64.tar.gz
tar xvzf tg-captcha-bot_1.1.10_linux_amd64.tar.gz
mv tg-captcha-bot /usr/local/bin/tg-captcha-bot
chmod +x /usr/local/bin/tg-captcha-bot
- Move bot's config to needed path
mkdir -p /etc/tg-captcha-bot
cp config.toml /etc/tg-captcha-bot/config.toml
- Create systemd unit file
/etc/systemd/system/tg-captcha-bot.service
[Unit]
Description=tg-captcha-bot
Wants=network-online.target
After=network-online.target
[Service]
Environment="TGTOKEN=your_token"
Environment="CONFIG_PATH=/etc/tg-captcha-bot"
Type=simple
ExecStart=/usr/local/bin/tg-captcha-bot
Restart=always
RestartSec=3s
[Install]
WantedBy=multi-user.target
- Reload configuration and restart service
systemctl daemon-reload
systemctl restart tg-captcha-bot.service
- Check service status
systemctl status tg-captcha-bot.service
- Check logs
journalctl -u tg-captcha-bot.service
- Add the bot to your supergroup and give it administrator privileges