Giter Site home page Giter Site logo

tg-captcha-bot's Introduction

Go Report Card

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 supergroups (1500+ 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
    restart: unless-stopped
    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

Commands

/healthz - check that the bot is working correctly

С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

tg-captcha-bot's People

Contributors

mxssl avatar aprosvetova avatar darwinnn avatar berkus avatar denisgolius avatar tobiasmuehl avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.