Midnight Developmentdocs
Discord Roles

Installation

Create a Discord bot, get your IDs, and get the resource running

Create a Discord bot

  1. Go to the Discord Developer Portal and create a new application.
  2. Open the Bot tab, add a bot, and copy its token. Keep this secret.
  3. Under OAuth2 → URL Generator, tick the bot scope (no bot permissions are required), generate the invite link, and use it to add the bot to your Discord server.

No privileged intents need to be enabled. This resource only looks up one member at a time by ID, which doesn't require the Server Members intent.

Get your IDs

Enable Developer Mode in Discord (User Settings → Advanced), then:

  • Right-click your server icon → Copy Server ID for Config.Discord.GuildId.
  • Right-click each role in Server Settings → Roles → Copy Role ID for Config.RoleGroups.

Configure

Edit config.lua with the bot token, guild ID, and role → group mapping. See the Configuration page for what each option does.

Install

  1. Copy the resource folder into your server's resources directory.

  2. Add ensure md_discord to server.cfg, after the line that starts your framework (es_extended, qb-core, or qbx_core) if you use one, so auto-detection sees it as already started.

  3. To use the /discordsync admin command, grant it to whichever group should be allowed to force a resync:

    add_ace group.admin command.discordsync allow

On start, the console prints which framework it detected and whether the bot token was verified. If either check fails, it prints the reason and does not start syncing.

On this page