This Python script implements a Telegram bot that verifies new chat members before granting them full access to the chat. It uses the Telebot library to interact with the Telegram Bot API.
- Restricts new chat members from sending messages immediately upon joining.
- Prompts new members to verify themselves with a button click within a specified time limit.
- Automatically kicks members if verification fails (member does not click the button in time).
- Uses callback handling to manage verification status.
- Python 3.x
- Telebot library (
pip install pyTelegramBotAPI
)
-
Obtain Telegram Bot Token:
- Obtain a Telegram Bot token by creating a new bot through the BotFather on Telegram.
- Replace
YOUR_BOT_TOKEN
in the script (main.py
) with your actual bot token obtained from BotFather.
-
Adjust Verification Time: Modify
verification_time
inmain.py
for the duration new members have to verify themselves. -
Customize Messages and Button: Edit
text
andbutton_text
inmain.py
for the welcome message and button text. -
Bot Permissions: Ensure your bot has admin rights in the chat for member management.
-
Run the Script:
- Run the script using Python (
python main.py
).
- Run the script using Python (