Code Monkey home page Code Monkey logo

fish-telegram-captcha-bot's Introduction

Fish-Telegram-Captcha-bot

A telegram bot running on vercel to verify if the user is a human.

Workflow

video_2022-09-10_11-41-33.mp4

Usage

Verification-After-Request Mode

Public group

  1. Enable "Approve new members" in the group settings. image
  2. Add the bot to this group.
  3. Promote the bot to admin.
  4. Edit admin rights, minimum rights are recommended. image

Private group

  1. Go to "Group Settings" -> "Manage Invite Links".
  2. Create a new invite link with "Request Admin Approval" enabled. image
  3. Add the bot to this group.
  4. Promote the bot to admin.
  5. Edit admin rights, minimum rights are recommended. image

Notice: DO NOT Use the default invite link

There is a default invite link for a private groupchat in Telegram, which at the top of link list. The property of this invite link cannot be changes, which means that this bot cannot verify the new member joined with this invite link.

Verification-After-Join Mode

In the groups linked with a channel, you can use this mode to verify new members.

  1. Add the bot to a group.
  2. Promote the bot to admin.
  3. Edit admin rights, minimum rights are recommended. image

Notice: The permission of "Invite Users via Link" CAN NOT be enabled on verification-after-join mode.

The bot will automatically handle the verification process. New members will be restricted after joining the group until they pass the CAPTCHA.

How to deploy?

What you need:

  • A vercel account
  • The your telegram bot token
  • The site-key and secret-key of your hCaptcha

Deploy to vercel

  1. Create your telegram bot via @BotFather
  2. Go to the Settings tab to get your secret key.
  3. Go to the Sites tab and create a new site key.
  4. Fork this repo or click the button below to deploy it to vercel.
  5. Go to the Environment Variables tab and add the following variables:
    • BOT_TOKEN: The token of your telegram bot.
    • SECRET_KEY: The secret key of your hCaptcha account.
    • SITE_KEY: The site key of your active site.
  6. Redeploy the project to make the environment variables take effect.
  7. Set up the webhook by requesting https://api.telegram.org/bot[BOT_TOKEN]/setWebhook?url=https://[YOUR_DOMAIN]/webhook/[BOT_TOKEN]

Deploy with Vercel

Deploy to your own server

Due to the limitations of vercel, Verification-After-Join mode only can work on your own server.

  1. Deploy the project to vercel, but skip the step on setting the webhook.
  2. Get the latest build on GitHub Action.
  3. Copy the url which assigned to your Production Deployment on vercel.
  4. Run the bot on your server:
    FRONTEND_URL="YOUR_DEPLOYMENT_URL" \
    BOT_TOKEN="YOUR_BOT_TOKEN" \
    ./Fish-Telegram-Captcha-Bot

fish-telegram-captcha-bot's People

Contributors

xiaomengxinx avatar lz233 avatar

Watchers

 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.