MCPcopy Index your code
hub / github.com/PastKing/tgbot-verify

github.com/PastKing/tgbot-verify @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
173 symbols 626 edges 38 files 149 documented · 86%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SheerID Auto-Verification Telegram Bot

Stars Forks Issues License

🤖 Automated SheerID Student/Teacher Verification Telegram Bot

Based on @auto_sheerid_bot GGBond's legacy code with improvements

简体中文 | 繁體中文 | English


📋 Overview

A Python-based Telegram bot that automates SheerID student/teacher identity verification for multiple platforms. The bot automatically generates identity information, creates verification documents, and submits them to the SheerID platform, significantly simplifying the verification process.

🎯 Supported Services

Command Service Type Status
/verify Gemini One Pro Teacher ✅ Complete
/verify2 ChatGPT Teacher K12 Teacher ✅ Complete
/verify3 Spotify Student Student ✅ Complete
/verify4 Bolt.new Teacher Teacher ✅ Complete
/verify5 YouTube Premium Student Student ⚠️ In Progress

⚠️ Before Use: The programId in each module's config.py may need periodic updates. If verification keeps failing, please update accordingly. See the Configuration section below.

✨ Key Features

  • 🚀 Automated Process: One-click info generation, document creation, and submission
  • 🎨 Smart Generation: Auto-generates student/teacher ID PNG images
  • 💰 Points System: Check-ins, invitations, and redemption codes
  • 🔐 Secure & Reliable: MySQL database with environment variable configuration
  • Concurrency Control: Intelligent management of concurrent requests for stability
  • 👥 Admin Features: Complete user and points management system

🛠️ Tech Stack

  • Language: Python 3.11+
  • Bot Framework: python-telegram-bot 20.0+
  • Database: MySQL 5.7+
  • Browser Automation: Playwright
  • HTTP Client: httpx
  • Image Processing: Pillow, reportlab, xhtml2pdf
  • Environment Management: python-dotenv

🚀 Quick Start

1. Clone Repository

git clone https://github.com/PastKing/tgbot-verify.git
cd tgbot-verify

2. Install Dependencies

pip install -r requirements.txt
playwright install chromium

3. Configure Environment Variables

Copy env.example to .env and fill in the configuration:

BOT_TOKEN=your_bot_token_here
CHANNEL_USERNAME=your_channel
CHANNEL_URL=https://t.me/your_channel
ADMIN_USER_ID=your_admin_id

MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=tgbot_verify

4. Start Bot

python bot.py

🐳 Docker Deployment

cp env.example .env
nano .env
docker-compose up -d
docker-compose logs -f

Manual build:

docker build -t tgbot-verify .
docker run -d --name tgbot-verify --env-file .env -v $(pwd)/logs:/app/logs tgbot-verify

📖 Usage

User Commands

/start              # Start (register)
/about              # Learn about bot features
/balance            # Check points balance
/qd                 # Daily check-in (+1 point)
/invite             # Generate invitation link (+2 points/person)
/use <code>         # Redeem points with code
/verify <link>      # Gemini One Pro verification
/verify2 <link>     # ChatGPT Teacher K12 verification
/verify3 <link>     # Spotify Student verification
/verify4 <link>     # Bolt.new Teacher verification
/verify5 <link>     # YouTube Premium Student verification
/help               # View help

Admin Commands

/addbalance <user_id> <points>               # Add user points
/block <user_id>                             # Block user
/white <user_id>                             # Unblock user
/blacklist                                   # View blacklist
/genkey <code> <points> [times] [days]       # Generate redemption code
/listkeys                                    # View redemption codes
/broadcast <text>                            # Broadcast notification

Verification Process

  1. Visit the service's verification page and start the verification flow
  2. Copy the full URL from browser address bar (including verificationId)
  3. Send to bot: /verify3 https://services.sheerid.com/verify/xxx/?verificationId=yyy
  4. Wait for processing — review usually completes within minutes

📁 Project Structure

tgbot-verify/
├── bot.py                  # Main bot program
├── config.py               # Global configuration
├── database_mysql.py       # MySQL database management
├── env.example             # Environment variables template
├── requirements.txt        # Python dependencies
├── Dockerfile              # Docker configuration
├── docker-compose.yml      # Docker Compose configuration
├── handlers/               # Command handlers
│   ├── user_commands.py
│   ├── admin_commands.py
│   └── verify_commands.py
├── one/                    # Gemini One Pro module
├── k12/                    # ChatGPT K12 module
├── spotify/                # Spotify Student module
├── youtube/                # YouTube Premium module
├── Boltnew/                # Bolt.new module
├── military/               # ChatGPT Military verification docs
└── utils/                  # Utility functions
    ├── messages.py
    ├── concurrency.py
    └── checks.py

⚙️ Configuration

Environment Variables

Variable Required Description
BOT_TOKEN Telegram Bot Token
ADMIN_USER_ID Admin Telegram ID
MYSQL_HOST MySQL host address
MYSQL_USER MySQL username
MYSQL_PASSWORD MySQL password
MYSQL_DATABASE Database name
CHANNEL_USERNAME Channel username (default: pk_oa)
CHANNEL_URL Channel link
MYSQL_PORT MySQL port (default: 3306)

Updating programId

If verification keeps failing, the programId is likely outdated. To update:

  1. Open the service's verification page, press F12 → Network tab
  2. Start verification, find the https://services.sheerid.com/rest/v2/verification/ request
  3. Extract programId and update the corresponding module's config.py

Files to update: one/config.py | k12/config.py | spotify/config.py | youtube/config.py | Boltnew/config.py

Points Configuration (config.py)

VERIFY_COST = 1        # Points cost per verification
CHECKIN_REWARD = 1     # Daily check-in reward
INVITE_REWARD = 2      # Invitation reward
REGISTER_REWARD = 1    # Registration reward

🤝 Contact & Collaboration

Open to collaboration — feel free to reach out via the above channels.


🛠️ Contributing / Secondary Development

Welcome to fork and build upon this project. Please:

  • Keep original repository link and author credits
  • Follow MIT License — derivative projects must also be open source
  • Free for personal use; commercial use is at your own risk

📜 License

This project is licensed under the MIT License.


🙏 Acknowledgments

  • Thanks to @auto_sheerid_bot GGBond for the legacy code foundation
  • Thanks to all developers who contributed to this project

📊 Statistics

Star History Chart


⭐ If this project helps you, please give it a Star!

Made with ❤️ by PastKing

Core symbols most depended-on inside this repo

get_connection
called by 16
database_mysql.py
user_exists
called by 14
database_mysql.py
get_user
called by 13
database_mysql.py
reject_group_command
called by 13
utils/checks.py
add_balance
called by 12
database_mysql.py
is_user_blocked
called by 10
database_mysql.py
add_verification
called by 6
database_mysql.py
_sheerid_request
called by 6
Boltnew/sheerid_verifier.py

Shape

Function 84
Method 78
Class 11

Languages

Python100%

Modules by API surface

database_mysql.py22 symbols
Boltnew/sheerid_verifier.py12 symbols
youtube/sheerid_verifier.py10 symbols
spotify/sheerid_verifier.py10 symbols
one/sheerid_verifier.py10 symbols
Boltnew/img_generator.py10 symbols
k12/sheerid_verifier.py9 symbols
utils/concurrency.py8 symbols
handlers/verify_commands.py8 symbols
handlers/user_commands.py7 symbols
handlers/admin_commands.py7 symbols
youtube/name_generator.py6 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add tgbot-verify \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact