A professional WHMCS addon module that integrates with Discord to automatically verify clients and assign roles based on their account status.
- OAuth2 Discord Authentication: Secure Discord verification using OAuth2 flow
- Automatic Role Assignment: Assigns different roles based on active WHMCS products
- Automatic Guild Joining: Adds users to your Discord server when they verify
- Real-time Updates: Hooks into WHMCS events for instant role synchronization
- Daily Synchronization: Cron job ensures roles stay in sync
- Environment Variable Support: Secure credential management
- Comprehensive Logging: Full activity and API call logging for debugging
-
Upload Files: Copy the entire addon directory to your WHMCS installation:
/path/to/whmcs/modules/addons/discord_verification/ -
Activate Module:
- Go to Setup → Addon Modules in WHMCS Admin
- Find "Discord Client Verification" and click Activate
-
Configure Module:
- Click Configure next to the activated module
- Fill in your Discord application credentials:
- Discord Client ID: Your Discord app's client ID
- Discord Secret ID: Your Discord app's client secret
- Discord Bot Token: Your Discord bot token
- Discord Guild ID: Your Discord server ID
- Active Role ID: Role ID for clients with active products
- Default Role ID: Role ID for verified clients without active products
- Auto Join Server: Enable to automatically add users to your Discord server when they verify
-
Create Discord Application:
- Go to Discord Developer Portal
- Create a new application
- Note the Client ID and Client Secret
-
Create Bot:
- In your application, go to the Bot section
- Create a bot and copy the Bot Token
- Enable required bot permissions:
Manage Roles
-
Set OAuth2 Redirect URI:
- In OAuth2 → General, add redirect URI:
https://yourdomain.com/index.php?m=discord_verification -
Configure OAuth2 Scopes:
- In OAuth2 → URL Generator, select the following scopes:
identify- Required for basic user informationemail- Optional but recommendedguilds.join- Required for automatic server joining
- In OAuth2 → URL Generator, select the following scopes:
-
Invite Bot to Server:
- Use OAuth2 URL Generator with
botscope and the following permissions:Manage Roles- Required for role assignmentManage Guild- Required for auto-joining users to the server
- Ensure bot role is higher than roles it needs to assign
- Use OAuth2 URL Generator with
For enhanced security, you can use environment variables:
export DISCORD_CLIENT_ID="your_client_id"
export DISCORD_SECRET_ID="your_client_secret"
export DISCORD_BOT_TOKEN="your_bot_token"These will override module configuration settings.
-
Client Verification:
- Clients visit:
https://yourdomain.com/index.php?m=discord_verification - They authenticate with Discord and get verified
- Roles are automatically assigned based on account status
- Clients visit:
-
Admin Management:
- Go to Setup → Addon Modules → Discord Client Verification
- View statistics: total verified users, active vs default role counts
- See all verified users with their Discord info and role status
- Sync All Users: Manually trigger role synchronization for all users
- Individual Actions: Sync or remove Discord associations per user
-
Client Area Widget:
- Optional sidebar widget showing Discord verification status
- Shows "Active Member", "Verified", or "Not Verified" badges
- Quick access buttons to verify or manage Discord connection
- Can be enabled/disabled in addon configuration
-
Automatic Role Management:
- Roles update when services are activated/suspended/terminated
- Daily cron job ensures synchronization
- Manual role updates via admin interface or activity log
- Check WHMCS Activity Log: All operations are logged for debugging
- Verify Discord Permissions: Ensure bot has
Manage Rolespermission - Check Role Hierarchy: Bot role must be higher than assigned roles
- Validate OAuth2 Settings: Ensure redirect URI matches exactly
- WHMCS 7.0+
- PHP 7+
- cURL extension
- Valid Discord application with bot
This project is licensed under the GNU General Public License v3.0 (GPLv3).
- You may use, modify, and redistribute this module freely.
- Any distributed modifications must remain under GPLv3.
- Commercial resale of closed-source versions is not allowed.
Full license text is in the LICENSE file.
- Website: https://26bz.online
- Discord: https://26bz.online/discord