Discord Bot
Link Discord accounts, assign roles, and send direct messages to players.
Discord Bot connects a player’s Minexon account to their Discord account. Players can use that connection to sign in, receive roles in your Discord server, and get direct messages (DMs) about their activity. For announcements in a shared Discord channel, see Discord Webhooks.
Set up and invite the bot
- Create a Discord application in the Discord Developer Portal. Get its Client ID and Client Secret from OAuth2, and its Bot Token from Bot. Use Reset Token if you need a new token. This invalidates the previous token. Discord Developer Portal · Discord bot setup guide
- In Discord, enable User Settings → Advanced → Developer Mode. Right-click the server where the bot will operate and select Copy Server ID. The bot uses this server for every role and nickname update.
- In Minexon, open Settings → Discord Bot → Settings. Fill in the four fields under Bot credentials, turn on Discord Bot, and save. On later edits, leave Bot Token and Client Secret blank to keep the saved values.
- Copy the OAuth2 redirect URL shown in Minexon. Add it exactly as displayed to OAuth2 → Redirects in the Discord application and save. For example,
https://site.example/account/discord/callback. If your domain or installation path changes, add the new URL shown in Minexon. Discord OAuth2 documentation - Select Add Bot to Your Server. Confirm the Discord server and authorize the invite. Minexon’s invite requests the Administrator permission. Move the bot’s highest role above the roles it will assign. To change a member’s nickname, the bot’s highest role must also be above that member’s highest role. Discord role hierarchy

Connect, sign in, and create an account
| Action | Dashboard requirement | What the player does |
|---|---|---|
| Connect an existing account | Discord Bot and the Linked accounts module are on | Signs in, opens Profile → Linked accounts → Discord → Connect, and authorizes access. On return, the Discord card shows the connection status. |
| Sign in with Discord | Sign in with Discord is on | Chooses Discord on the sign-in screen. The same Discord identity must already be linked to an active Minexon account. Minexon still asks for two-step verification when enabled for the account. |
| Create an account with Discord | Create an account with Discord and site registration are on | Authorizes Discord and completes the Minexon registration form. A valid Discord username and a Discord-verified email address can be prefilled. The player supplies any remaining required fields and sets a site password if Discord sign-in is unavailable. |
Each Discord account can be linked to one Minexon account. A player without a site password must set one before unlinking. Unlinking leaves previously assigned Discord roles and nicknames in place. When another provider is required for sign-in or registration, Discord is hidden on that screen. Linked accounts · Provider settings
Players must join your Discord server before the bot can assign their roles or edit their nicknames. Linking a site account does not create server membership. Discord OAuth2 scopes
Automate roles and nicknames
Keep the Discord Bot notification module enabled in Settings → Modules. In Discord Bot → Settings → Roles and nicknames, enable the rules you want to use. Enable Discord Developer Mode and use Copy Role ID on each target role to get its numeric ID. Module settings
| Rule | When it runs | Required setting |
|---|---|---|
| Assign a role when an account is linked | A new Discord connection is saved | Discord Role ID |
| Match the Discord nickname to the site username when an account is linked | A new connection is saved, updating the player’s nickname in this Discord server | Enable the switch |
| Assign a role when a balance top-up completes | A balance top-up completes and credits the player’s account | Discord Role ID |
| Assign the product’s role when a store purchase completes | An order for a product with a Discord role completes | Enter the Discord role ID in the product settings |
| Assign a role when a forum topic is created | A topic is created, including topics awaiting moderation | Discord Role ID |
| Assign a role when a marketplace listing is created | A new marketplace listing is created | Discord Role ID |
Settings apply to new events. Turning on a rule does not grant roles for past purchases or existing account connections. The balance top-up role and its DM notification have separate switches.
Edit a direct message template
- Enable the event under Settings → Message notifications and select Save changes. The group counter shows how many events are enabled.
- Select Edit template beside the event or find it on the Messages tab. Each event has a default template. You can edit and save a template while its event is disabled.
- Use Editor to change the plain message or its embeds. An embed can include a title, description, color, link, fields, and images. Switch to JSON to edit the same message payload. Placeholders shows the tokens available for the selected event.
- Select Save changes to save the selected event’s template. At delivery,
%site_name%is replaced with the site name and%username%with the recipient’s Minexon username. Values such as order numbers and ticket titles come from the triggering event.

Example JSON for Discord account linked.
{
"content": "Hi %username%, your Discord account is now linked to %site_name%.",
"embeds": [
{
"title": "Account linked",
"description": "Linked Discord account **%discord_username%**",
"color": 3578062,
"footer": { "text": "%site_name%" }
}
]
}A template needs message text or at least one embed. Plain text has a 2,000-character limit. A message can contain up to 10 embeds and 6,000 total characters of embed text. The Discord application supplies the sender’s name and avatar. User and role mentions in the template do not trigger notifications.
Notification events and recipients
| Dashboard event | Recipient and trigger | Example placeholders |
|---|---|---|
| Store purchase | Buyer when a store order completes | %order_number%, %amount%, %order_url% |
| Marketplace sale | Seller when their listing sells | %item_name%, %amount%, %market_url% |
| Payment completed | Player whose payment completes | %payment_reference%, %amount% |
| Cart reminder (after 2 hours) | Player who still has cart items at least two hours after the cart last changed | %cart_url% |
| Gift received | Player who receives a product or balance gift | %sender_name%, %product_name%, %inventory_url% |
| Game Night reminder (3 hours before) | Active players with verified email addresses during the three hours before the event | %event_name%, %starts_at%, %event_url% |
| Balance top-up | Player whose top-up completes | %amount%, %balance% |
| Product expiry reminder (1 day before) | Player whose time-limited product access is due to expire | %product_name%, %expires_at% |
| Support reply · Support ticket closed | Owner of the ticket that was answered or closed | %ticket_title%, %ticket_url% |
| Application updated | Player whose application status changed | %application_title%, %status%, %application_url% |
| Leaderboard reward | Player whose leaderboard reward is delivered | %leaderboard_name%, %rank%, %reward_name% |
| News comment approved | Author of the approved comment | %news_title%, %news_url% |
| Forum topic approved · Forum reply approved | Author of the approved topic or reply | %topic_title%, %topic_url% |
| Forum report resolved | Player who submitted the resolved report | %report_number% |
| New forum topic reply | Topic owner when another player replies | %author_name%, %topic_title%, %topic_url% |
| Password reset | Player who requests a reset | %reset_url% is required |
| Email verification · Email address change | Account owner after the email containing the code is sent | The verification code is delivered by email |
| Password changed | Player whose password changes | %username%, %site_name% |
| Discord account linked | Player who connects a Discord identity | %discord_username%, %discord_id% |
Messages go to the Discord account linked when the event occurs. With both Payment completed and Balance top-up enabled, a single top-up can send two DMs. New forum topic reply goes to the topic owner, while Forum reply approved goes to the reply author.
Verify the first connection
Use a test player who has joined your Discord server. Enable Assign a role when an account is linked and Discord account linked, then connect the test account. The hosting Notifications job processes DMs, roles, and nicknames. The connection appears on the site immediately, and roles or messages can wait for the next run. The job can retry temporary Discord errors and rate limits. Scheduled tasks
| Symptom | What to check |
|---|---|
| Discord is missing from the site | Check the bot’s main switch, saved credentials, sign-in or registration settings, and any required provider. Linking from a profile also requires the Linked accounts module. |
| Discord authorization cannot return to the site | Compare Minexon’s displayed redirect URL with the Discord application’s Redirects entry. Start a fresh attempt from the site’s HTTPS address. |
| Account is linked but the role is missing | Check the notification job, server and role IDs, the player’s server membership, and the bot’s role hierarchy. For a purchase role, check the product’s role ID as well. |
| Role arrived but the DM did not | Check the saved event switch and ask the player to check Discord’s DM permissions and Message Requests. Linking leaves the player’s Discord privacy settings in place. Discord DM troubleshooting · Message Requests |
| Password reset link is missing | Keep the %reset_url% placeholder in the reset template. Request a fresh reset to test a current link. |