Skip to content

Discord Bot Configuration Guide

Setting up a Discord bot allows you to tightly control who can access your Fivemon server and with what level of priority in the queue using discord roles.

You can also:

  • Mark certain users as verified to prevent alternate accounts or ensure identity
  • Grant specific roles admin powers within the system
  • Automatically display each player’s Discord username and profile picture on the loading screen
  • Broadcast announcements from a specific channel directly into the game

This guide explains how to configure your custom Discord bot to integrate with your Fivemon server.


1. Creating the Bot

To get started, you need to:

  • Create a custom bot at Discord Developer Portal.
  • Click on "New Application" in the top right corner.
  • Go to "Bot" section, click on "Reset Token" and the copy bot token. Save it somewhere.
  • Go down to the section "Privileged Gateway Intents" and in "Message Content Intent" activate it.
  • Go to "OAuth2" section, in "OAuth2 URL Generator" select "bot" and in "bot permissions" select "Administrator".
  • Access the link below and add it to your community discord server.

2. Configuration Overview

The configuration for the bot is done inside your @uri-config/data/config/onlyserverconfig.json using the following structure:

"discord": {
    "token": "YOUR_DISCORD_BOT_TOKEN",
    "guild": "YOUR_DISCORD_SERVER_ID",
    "announcements": "ANNOUNCEMENT_CHANNEL_ID",
    "roles": {
        "whitelist": "WHITELIST_ROLE_ID",
        "verified": "VERIFIED_ROLE_ID",
        "priority_plus": "PRIORITY_PLUS_ROLE_ID",
        "priority_plus_plus": "PRIORITY_PLUS_PLUS_ROLE_ID",
        "admin": "ADMIN_ROLE_ID"
    },
    "whitelist_roles": ["whitelist"],
    "queue_roles": ["priority_plus", "priority_plus_plus"],
    "verified_roles": ["verified"],
    "admin_roles": ["admin"]
}

token

Your bot’s private token. Do not share this.

guild

The Discord server ID where the bot is installed.

announcements

The ID of the channel where the bot will read announcements.


3. Role Management

roles

Here you define custom role mappings. You can assign any internal label you like (e.g., whitelist, verified) and link it to the corresponding Discord role ID.

Example:

"roles": {
    "whitelist": "1234567891234567890",
    "verified": "1234567891234567890",
    "priority_plus": "1234567891234567890",
    "priority_plus_plus": "1234567891234567890"
}

whitelist_roles

Used to restrict access before entering the server (this is not the same as the in-game whitelist).

  • Set to null to disable this check.

  • Set to an array of role names (as defined in roles) to allow only those roles through.

Example:

"whitelist_roles": ["whitelist"]
"whitelist_roles": null

queue_roles

Controls priority in the join queue. Roles listed earlier in the array will have lower priority, and roles at the end will have the highest.

Example:

json

"queue_roles": ["priority_plus", "priority_plus_plus"]

In this case, priority_plus_plus has higher queue priority than priority_plus.


verified_roles

Used for servers that want stricter identity control. Accounts with one of these roles are considered verified and less likely to be alternate accounts.


admin_roles

If you want certain Discord roles to automatically have admin permissions in the system, you can list them here by name.

Example:

"admin_roles": ["admin"]

Final Notes

  • All role references in whitelist_roles, queue_roles, verified_roles, and admin_roles must match the names used in the roles section.

  • Ensure your bot has the correct permissions and intents to operate fully.

  • Keep your bot token private. Do not commit it to public repositories or share it.

This system allows tight integration between Discord and Fivemon, providing additional layers of control and automation.