A full Discord bot integration for Paymenter, allowing users to link their accounts via OAuth2 and manage services, invoices, and tickets directly from Discord slash commands.
Author: Buster4126 Version: 1.5 License: Free — All rights reserved Support: Discord
- Account Linking via Discord OAuth2
- Auto Role Assignment when a user links/unlinks their account
- DM Notifications for new invoices, ticket replies, and expiring services
- Slash Commands for users:
/help— List all available commands/link— Link your Paymenter account/unlink— Unlink your account/profile— View your account summary/balance— View your credit balance/services— View your active services/invoices— View your pending invoices/tickets— View your open support tickets/createticket— Create a support ticket from Discord
- Admin Slash Commands (restricted by role):
/staffhelp— List all staff commands/seeservices @user— View services of a linked user/seeinvoices @user— View invoices of a linked user/seetickets @user— View tickets of a linked user/credit add @user <amount>— Add credits to a user/credit remove @user <amount>— Remove credits from a user/config list— View all commands and their enabled/disabled status/config enable <command>— Re-enable a disabled command/config disable <command>— Disable a command
- Admin Panel — View and manage all linked Discord accounts
- Paymenter (latest version)
- PHP with the
sodiumextension enabled (standard on most VPS setups) - A Discord application & bot (Discord Developer Portal)
- Your Paymenter instance must be publicly reachable over HTTPS
- A valid license key
- Go to discord.com/developers/applications and click New Application
- Give it a name (e.g. your company name) and confirm
- In your application, go to Bot in the left sidebar
- Click Add Bot (or the bot is already created)
- Under Token, click Reset Token and copy it — this is your Bot Token
- Scroll down to Privileged Gateway Intents and enable:
- Server Members Intent
- Save changes
Open General Information in the left sidebar and copy:
- Application ID
- Public Key
Open OAuth2 in the left sidebar and copy:
- Client Secret (click Reset Secret if needed)
You now have all 4 credentials needed for the extension.
- Copy the
Discordfolder into your Paymenter extensions directory:extensions/Others/Discord/ - Go to Admin Panel → Extensions → Others
- Find Discord Integration and click Install
- Fill in all configuration fields:
| Field | Where to find it |
|---|---|
| Bot Token | Discord Developer Portal → Bot → Token |
| Application ID | Discord Developer Portal → General Information |
| Public Key | Discord Developer Portal → General Information |
| OAuth2 Client Secret | Discord Developer Portal → OAuth2 → Client Secret |
| Guild ID | Right-click your Discord server → Copy Server ID (optional but recommended for instant command registration) |
| Linked Role ID | Right-click the role in your server → Copy Role ID (optional) |
| Admin Role ID | Right-click the role in your server → Copy Role ID (optional) |
| Supporter Role ID | Right-click the role in your server → Copy Role ID (optional) |
| Credit Currency | e.g. USD or EUR (optional, defaults to USD) |
Note: To copy IDs in Discord, you must have Developer Mode enabled. Go to Discord Settings → Advanced → Developer Mode and toggle it on.
- Click Save — the slash commands are now registered automatically
- In the Discord Developer Portal, go to OAuth2
- Under Redirects, click Add Redirect and enter:
Replace
https://YOUR_DOMAIN/discord/oauth/callbackYOUR_DOMAINwith your actual domain (e.g.panel.example.com) - Click Save Changes
Important: Complete Step 4 (save the extension settings including the Public Key) before doing this step. Discord will immediately verify the URL using the Public Key — if it is not saved yet, validation will fail.
- In the Discord Developer Portal, go to General Information
- Under Interactions Endpoint URL, enter:
https://YOUR_DOMAIN/discord/interactions - Click Save Changes — Discord will send a test request to verify the endpoint
- In the Discord Developer Portal, go to OAuth2 → URL Generator
- Under Scopes, select:
botapplications.commands
- Under Bot Permissions, select:
Manage Roles(only needed if you use the Linked Role feature)Send Messages
- Copy the generated URL, open it in your browser, and invite the bot to your server
"The provided interactions endpoint URL could not be verified" → Make sure you have saved the extension settings with the correct Public Key in Paymenter before entering the URL in the Developer Portal.
"Bot didn't respond in time" → Your Paymenter instance must be reachable over HTTPS from the internet. Check that port 443 is open and your SSL certificate is valid.
Slash commands don't appear in Discord
→ If you set a Guild ID, commands appear instantly. Without a Guild ID, global commands can take up to 1 hour to propagate.
→ Make sure the bot has been invited with the applications.commands scope (see Step 7).
→ You can manually re-register all commands via SSH from your Paymenter directory:
php artisan tinker --execute="
\$settings = \App\Models\Extension::where('extension', 'Discord')->where('type', 'other')->first()->settings->pluck('value', 'key')->toArray();
\$discord = new \Paymenter\Extensions\Others\Discord\Discord(\$settings);
\$discord->registerDiscordCommands();
echo 'Done';
"/link gives an error or the OAuth flow doesn't work
→ Double-check that the redirect URL in OAuth2 → Redirects matches exactly:
https://YOUR_DOMAIN/discord/oauth/callback
"Permission denied" error on storage/logs when installing/updating → Run this in your Paymenter directory via SSH to fix the file ownership:
chown -R www-data:www-data storage/Then try installing/updating the extension again.
This happens when Artisan commands were previously run as
root. To avoid it in the future, prefix artisan commands withsudo -u www-data.
"Permission denied" when uploading the extension (rename ... Permission denied)
→ The web server has no write access to the extensions/ folder. Fix it with:
chown -R www-data:www-data extensions/Then upload the extension again.
- Go to Admin Panel → Extensions → Others → Discord Integration and click Uninstall
- Replace the
Discordfolder with the new version - Go back to Admin Panel → Extensions → Others and click Install
- Re-enter your configuration and save — slash commands will be re-registered automatically
After updating, clear the Laravel cache via SSH from your Paymenter directory:
sudo -u www-data php artisan cache:clearAdditionally, if applicable:
- Queue Worker running (
QUEUE_CONNECTION=redisordatabase) → restart it:sudo -u www-data php artisan queue:restart
- PHP Opcache enabled → reload PHP-FPM or the web server so the new code is picked up:
sudo systemctl reload php8.x-fpm
- Added
/config list|enable|disable— Admins can now enable/disable individual commands without editing code - Fixed migration path bug that prevented the
ext_discord_userstable from being created on install
- Initial public release