Skip to content

Latest commit

 

History

History
75 lines (51 loc) · 1.35 KB

INSTALL-3.md

File metadata and controls

75 lines (51 loc) · 1.35 KB

systemd

Prerequisites

Obtain bot token from @BotFather

Instructions

  1. Clone the repo
git clone https://github.com/mxssl/tg-captcha-bot.git
cd tg-captcha-bot
  1. 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
  1. Move bot's config to needed path
mkdir -p /etc/tg-captcha-bot
cp config.toml /etc/tg-captcha-bot/config.toml
  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