J-Rios/TLG_JoinCaptchaBot
소개
그룹에 새로 참여한 사용자가 사람인지 확인하는 텔레그램 봇입니다. 새 사용자마다 CAPTCHA를 보내고, 정해진 시간 안에 풀지 못하면 그룹에서 내보냅니다.
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- -2
- in 15 days
- -1
- in 1 month
- +3
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalTLG_JoinCaptchaBot
Overview
TLG_JoinCaptchaBot is a Telegram Bot designed to verify that new members joining a group are humans by presenting a CAPTCHA challenge.
The bot:
- Automatically sends a CAPTCHA when a new user joins
- Removes users who fail to solve the CAPTCHA within a specified time limit
- Deletes messages containing URLs sent by users who haven't completed the CAPTCHA (anti-spam)
- Block new users to send media messages before the captcha is not solved
- Provides different captcha modes, like visual animated video captchas, image captchas, custom poll captchas, etc
- Has multilanguage support with near to ~30 languages
- Allows custom configuration per group (time for solving the captcha, captcha mode, difficulty, language, welcome message, etc)
- Keeps the groups clean from Bot and captcha messages by automatically self-removing them after a while.
Table of Contents
- Requirements
- Installation
- Configuration
- Usage
- Deployment
- Advanced Features
- Language Contributors
- Support Development
Requirements
- Python 3.12+
- Manim requirements
- Pillow requirements
- Telegram Bot Token (from @BotFather)
Installation
1. Install Pillow & Manim prerequisites
sudo apt update
sudo apt install -y build-essential make libcairo2-dev libpango1.0-dev
sudo apt install -y libtiff5-dev libjpeg62-turbo-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev
2. Install Python3 and tools
sudo apt-get install python3 python3-pip python3-venv python3-tk
3. Get and setup the project
git clone https://github.com/J-Rios/TLG_JoinCaptchaBot
cd TLG_JoinCaptchaBot
make setup
4. Configure your Telegram Bot token
Edit the src/settings.py file:
'TOKEN' : 'XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
Configuration
Configuration is handled through the src/settings.json file. Advanced users can also use environment variables, which is useful for deployment scenarios with virtual environments or Docker.
Usage
A Makefile is provided for convenient operation:
# View available commands
make
# Start the bot
make start
# Check bot status
make status
# Stop the bot
make stop
Deployment
Systemd Service
To run the bot as a daemon service on systemd-based systems:
- Create a service file:
sudo nano /etc/systemd/system/tlg_joincaptcha_bot.service
- Add the following content (adjust paths as needed):
[Unit]
Description=Telegram Join Captcha Bot Daemon
Wants=network-online.target
After=network-online.target
[Service]
Type=forking
WorkingDirectory=/path/to/TLG_JoinCaptchaBot/src/
ExecStart=/path/to/TLG_JoinCaptchaBot/tools/start
ExecReload=/path/to/TLG_JoinCaptchaBot/tools/kill
[Install]
WantedBy=multi-user.target
- Enable and start the service:
sudo systemctl enable --now tlg_joincaptcha_bot.service
sudo systemctl start tlg_joincaptcha_bot.service
- Check service status:
sudo systemctl status tlg_joincaptcha_bot.service
Docker
Docker support is available for easy deployment and server migration. See the Docker specific documentation for details on creating a Docker container for the bot.
Advanced Features
Bot Owner
The bot owner can execute special commands:
/allowgroup: Add groups to the allowed list (when bot is private)/allowuserlist: Exempt specific users from CAPTCHA verification (useful for accessibility needs)
Set a bot owner in settings.py:
"BOT_OWNER": "@YourUsername",
Make Bot Private
By default, anyone can add the bot to any group. To restrict usage to specific groups:
- Set the bot to private mode in
settings.py:
"BOT_PRIVATE": True,
- Use the
/allow_groupcommand to specify permitted groups.
Note: If a public group becomes a supergroup, the chat ID may change, requiring re-authorization.
Scalability (Polling or Webhook)
Polling (Default)
The bot periodically checks for updates from Telegram servers. This is suitable for small to medium deployments.
Webhook (For larger deployments)
The bot receives updates directly from Telegram servers, which improves performance for high-traffic bots.
To configure webhook:
- Generate SSL certificate:
openssl req -newkey rsa:2048 -sha256 -nodes -keyout private.key -x509 -days 3650 -out cert.pem
- Configure webhook settings in
settings.py:
"WEBHOOK_IP": "0.0.0.0",
"WEBHOOK_PORT": 8443,
"WEBHOOK_PATH": "/TLG_JoinCaptchaBot",
"WEBHOOK_CERT": SCRIPT_PATH + "/cert.pem",
"WEBHOOK_CERT_PRIV_KEY": SCRIPT_PATH + "/private.key",
- For reverse proxy setups (optional):
"WEBHOOK_URL": "https://example.com:8443/TLG_JoinCaptchaBot"
- Enable webhook mode:
"CAPTCHABOT_USE_WEBHOOK": True,
Language Contributors
Current texts are translated via AI, but initial language translations were done by the following contributors:
- Arabic: @damascene
- Basque: @xa2er
- Belarusian: @antikruk
- Catalán: Adela Casals i Jorba
- Chinese (Mainland): 神林
- Esperanto: Pablo Busto & Porrumentzio
- Finnish: Aminda Suomalainen (@Mikaela)
- French: Mathieu H (@aurnytoraink)
- Galician: Fernando Flores (Fer6Flores); Iváns
- German: @weerdenburg, @MossDerg
- Indonesian: ForIndonesian
- Italian: Noquitt, Nicola Davide (@nidamanx)
- Kannada: @itsAPK
- Korean: @dakeshi
- Persian: @m4hbod
- Portuguese (Brazil): Anahuac de Paula Gil
- Russian: Unattributed (anonymous), @stezkoy, Roman (@toxi22)
- Serbo-Croatian: @IlijaDj
- Slovak: @dumontiskooo
- Ukrainian: Vadym Zhushman (@zhushman00), Roman (@toxi22)
- Uzbek: @mhwebuz
Donate
If you find this bot useful, consider supporting the developer:
Paypal: https://www.paypal.me/josrios
관련 프로젝트 살펴보기
불러오는 중…