berkus / tg-captcha-bot

Сaptcha bot для Telegram

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telegram Captcha Bot

Telegram bot that validates new users that enter supergroup. Validation works like a simple captcha. Bot written in Go (Golang).

This bot has been tested on several large supergroups (1000+ people) for a long time and has shown its effectiveness against spammers.

How it works

  1. Add a bot to your supergroup
  2. Promote the bot for administrator privileges
  3. A new user enters your supergroup
  4. Bot restricts the user's ability to send messages
  5. Bot shows a welcome message and a captcha button to the user
  6. If the user doesn't press the button within 30 seconds then the user is banned by the bot

How to run

  1. Obtain bot token from @BotFather
  2. The main method to run this bot is Docker container
  3. Install Docker
  4. Install Docker Compose

Instructions

  1. Clone the repo
git clone https://github.com/mxssl/tg-captcha-bot.git
cd tg-captcha-bot
  1. Add a token from BotFather to env variable in docker-compose.yml
version: '3'

services:
  tg-captcha-bot:
    build:
      context: .
      dockerfile: Dockerfile
    image: tg-captcha-bot:latest
    volumes:
      - ./config.toml:/config.toml
    environment:
      - TGTOKEN="your_token"
  1. Build a Docker container
docker-compose build
  1. Run the container
docker-compose up -d
  1. Check that the bot started correctly
docker-compose ps
docker-compose logs
  1. Add the bot to your supergroup and give it administrator privileges

Сustomization

You can change several bot's settings through the configuration file config.toml

Contacts

If you have questions feel free to ask me in TG @mxssl

About

Сaptcha bot для Telegram


Languages

Language:Go 85.4%Language:Dockerfile 9.6%Language:Makefile 5.0%