Protect telegram groups from automated bots (spams, scams, adults, etc..)
Report Bug
·
Request Feature
With Telegram increasingly getting popular and popular social media option in recent years, it has become a target for s(p/c)ammers. Many groups and their members are bombarded by spam and unsolicited messages on daily basis, mostly attributed to the lack of built-in protections systems in place.
This project intends to mitigate these issues by forcing every new member to go through a captcha verification process thus making it harder for automated accounts/userbots to roam free in these groups.
Git clone the repo:
git clone https://github.com/TibebeJS/emoji-captcha-bot.gitChange directory into the newly created repository ("emoji-captcha-bot")
cd emoji-captcha-bot.gitInstall dependencies
npm iOpen up config/development/general.json5 file and provide botToken and challenge
{
botToken: "123456:bot token", // REPLACE with your token - from @BotFather
challenge: "text", // options: ['text-emoji', 'audio', 'image']
}E.g. if we choose 'text-emoji' as our challenge, then the config file would be config/development/text-emoji-captcha.json5
Example ("text-emoji-captcha.json5" file)
{
challengeEmojisCount: 5, // how many emojis to present in the challenge
answerEmojisColumns: 3, // number of columns in the answer's keypad
answerEmojisRows: 3, // number of rows in the answer's keypad
emojiSeparator: "-", // what's in between consecutive emojis
numberOfAttempts: 3, // number of attempts before restriction
timeout: 3000, // timeout before a challenge expires in milliseconds
emojiBlacklist: [ "🖕", "🍆", "🍑" ], // dont show these emojis
showCountryFlags: true, // show/hide country emojis
}After successful configuration, run the project:
npm start- Whenever a new member joins a group they will automatically be muted/restricted by the bot.
- Bot then sends a message which contains emojis (presented as text).
- User is prompted with emoji buttons to click on.
- if user successfully manages to select all the emojis that are present in the challenge, his/her restrictions will be lifted automatically by the bot.
- if the user runs out of attempts left before completing the challenge, he/she will remain restricted.
make sure to add the bot with "delete messages" and "ban users" permissions.
Example:
If everything goes well, here is how it looks like when a new member joins the group.
Sample Challenge: (type: text-emoji-challenge)
If text-emoji challenge has timed out:
- Text emojis challenge
- Attempts counter
- Add JSON configurations
- Restrict when a member joins
- Unrestrict after challenge
- Scrambled Image challenge (instead of just text)
- Audio challenge
- Timeouts
More details can be found over: Project canban


