A Discord bot that verifies YouTube channel subscriptions and automatically assigns a role to subscribers. That's it.
Subscriber Role is built specifically for any YouTube creator's Discord server. When a server member runs /verify, the bot authenticates them through Google OAuth2, checks their YouTube subscription status via the YouTube Data API, and automatically grants or revokes the configured "Subscriber" role, all without any manual work from the server admin.
- Admin setup - A server admin runs
/setup(requires Administrator permission), specifying the YouTube channel ID and the Discord role to assign to verified subscribers. - Member verification - A member runs
/verify, which opens a Google OAuth2 flow to securely link their YouTube account. - Subscription check - The bot queries the YouTube Data API to confirm the member is subscribed to the configured channel.
- Role assignment - If subscribed, the bot immediately grants the configured role. Roles are automatically removed if a subscription is later revoked.
| Command | Permission | Description |
|---|---|---|
/setup |
Administrator | Configure the YouTube channel and subscriber role for this server |
/verify |
Everyone | Link your YouTube account and verify your subscription to earn the role |
| File | Purpose |
|---|---|
main.py |
Starts the bot and API server |
bot.py |
Discord bot logic and slash command handlers |
api.py |
Web server handling the Google OAuth2 callback |
database.py |
Database interactions (tokens, server configs) |
utils.py |
Shared helpers (YouTube API calls, role management) |
This project is licensed under the AGPL-3.0, which means you are free to fork and self-host this bot. However, the setup involves multiple external services (Discord, Google Cloud, YouTube Data API, a database, and a publicly accessible server) and is non-trivial. No support will be provided for self-hosting. You're on your own.
Subscriber Role only accesses the minimum data required to function. The bot does not access your email, watch history, private content, or any other Google data. You can revoke access at any time from your Google Account Permissions page.
See the full Privacy Policy and Terms of Service for details.
Copyright (c) 2026 Ian Cheung. See LICENSE for details.