A telegram bot running on vercel to verify if the user is a human.
video_2022-09-10_11-41-33.mp4
- Enable "Approve new members" in group settings.
- Add the bot to the group.
- Promote the bot to admin.
- Edit the admin rights, minimum rights are recommended.
- Go to "Group Settings" -> "Manage Invite Links".
- Create a new invite link with "Request Admin Approval" enabled.
- Add the bot to the group.
- Promote the bot to admin.
- Edit the admin rights, minimum rights are recommended.
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 bot cannot verify the new member joined with this invite link.
In the groups linked with a channel, you can use this mode to verify new members.
- Add the bot to the group.
- Promote the bot to admin.
- Edit the admin rights, minimum rights are recommended.
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.
- A vercel account
- The
token
of your telegram bot - The
site-key
andsecret-key
of your hCaptcha
- Create your telegram bot via @BotFather
- Go to the Settings tab to get your secret key.
- Go to the Sites tab and create a new site key.
- Fork this repo or click the button below to deploy it to vercel.
- 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.
- Redeploy the project to make the environment variables take effect.
- Set the webhook by requesting
https://api.telegram.org/bot[BOT_TOKEN]/setWebhook?url=https://[YOUR_DOMAIN]/webhook/[BOT_TOKEN]
Due to the limitations of vercel, verification-after-join mode can only work on the deployment on your own server.
- Deploy the project to vercel, but skip the step of setting the webhook.
- Get the latest build on GitHub Action.
- Copy the url which assigned to your Production Deployment on vercel.
- Run the bot on your server:
FRONTEND_URL="YOUR_DEPLOYMENT_URL" \ BOT_TOKEN="YOUR_BOT_TOKEN" \ ./Fish-Telegram-Captcha-Bot