Obtain bot token from @BotFather
- Download a tarball of a preffered vesion
wget https://github.com/momai/tg-captcha-bot/archive/refs/tags/v.1.2.1.tar.gz
tar -xavf v.1.2.1.tar.gz
- Build the binary and place it in
$PATH
cd tg-captcha-bot-v.1.2.1/
make
mv bot /usr/local/bin/tg-captcha-bot
Run
CGO_ENABLED=0 make
if you would like to build the binary for another host
- Move bot's config to needed path
mkdir -p /etc/tg-captcha-bot
cp config.toml help_message.txt /etc/tg-captcha-bot/
- 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