Skip to content

Latest commit

 

History

History
72 lines (51 loc) · 1.3 KB

INSTALL-3.md

File metadata and controls

72 lines (51 loc) · 1.3 KB

systemd

Prerequisites

Obtain bot token from @BotFather

Instructions

  1. 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
  1. 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

  1. Move bot's config to needed path
mkdir -p /etc/tg-captcha-bot
cp config.toml help_message.txt /etc/tg-captcha-bot/
  1. 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
  1. Reload configuration and restart service
systemctl daemon-reload
systemctl restart tg-captcha-bot.service
  1. Check service status
systemctl status tg-captcha-bot.service
  1. Check logs
journalctl -u tg-captcha-bot.service
  1. Add the bot to your supergroup and give it administrator privileges