Agora

Create and set up your Discord bot, step by step

Create the bot in the Discord portal, set its options, invite it to your server and connect it to Agora.

Updated on Oct 4, 2026, 5:45 p.m.

On this page
  1. Before you start
  2. Open your application
  3. Set up the bot (Bot tab)
  4. Copy the bot token
  5. Invite the bot to your server
  6. Put the bot's role high enough
  7. Copy the server ID
  8. Connect the bot to Agora
  9. You know it worked when…
  10. If it does not work
  11. Go further

In short. The bot is optional: it is an automated account that gives your groups' Discord roles and sends direct messages (application decided…). Simplest is to create it in the same Discord application as your members' sign-in. Allow 5 minutes.

Before you start #

  • The getting-started setup is done: your Discord application (Agora's identity at Discord) already exists.
  • You have the Manage Server permission on your Discord server, to invite the bot there.
  • You are an administrator of the Hub (your Agora site), to paste the token in step 7.
  • A word stops you (token, intent, server ID…)? It is explained in the glossary.

1. Open your application #

  1. Go to https://discord.com/developers/applications and sign in.
  2. Open the application created when you set up Agora (the one used for Discord sign-in). Putting the bot there too is simplest; a separate application works as well: New Application, give it a name, accept the terms and Create.

The Discord portal Create a new application window: name, team, terms checkbox

Shortcut to the Bot tab. Once your application is open, its address looks like https://discord.com/developers/applications/123456789012345678/bot: the long number is the application ID (the Client ID, the same one as in Administration → Configuration → Discord connection, block Discord login (OAuth)). Replace it with yours, or keep the address from step 1 and click your application: the result is the same. This address requires being signed in to Discord.

2. Set up the bot (Bot tab) #

The Bot tab: icon, bot username and Reset Token button

OptionSettingWhy
Username / iconYour choiceThe name your members will see in Discord.
Public BotOffNobody but you can invite your bot to their server.
Requires OAuth2 Code GrantOffOtherwise the invite in step 4 fails.
Presence IntentOffAgora does not need it.
Server Members IntentOnThe bot must see server members to give them their roles, and to follow role changes made in Discord (Sync Discord → Agora). Without it, Agora falls back to the audit log (the bot's role then needs View Audit Log).
Message Content IntentOffAgora does not read messages.

Authorization Flow and Privileged Gateway Intents: Public Bot and OAuth2 Code Grant off, only Server Members Intent on

Click Save Changes in the bar that appears at the bottom of the page.

3. Copy the bot token #

  1. Still in Bot, click Reset Token and confirm.

The Reset Bot's Token? confirmation and its Yes, do it! button

  1. Copy the token shown (Copy button): it is shown only once.

The new token shown only once (blurred here) with the Copy button

The token is a password. Paste it nowhere but in Agora and never send it to anyone (not even support). If it leaked: Reset Token, then paste the new one in Agora; the old one stops working immediately.

4. Invite the bot to your server #

  1. OAuth2 → URL Generator tab.
  2. Scopes: tick bot.

The OAuth2 URL Generator: only the bot box is ticked

  1. Bot Permissions: tick Manage Roles. Nothing else is needed.

The bot permissions: only Manage Roles is ticked

  1. Integration Type: Guild Install. Copy the generated URL at the bottom and open it.

Integration Type Guild Install and the generated URL, with its copy button

  1. Pick your server and Continue. You need the Manage Server permission on that server.

The invite: Add to server, with the server picked in the list

  1. Check that Manage Roles is ticked, then Authorize.

The permission confirmation: Manage Roles ticked, Authorize button

Success! The application was authorized and added to the server

The MDT can link each department (police, EMS…) to its own Discord server: invite the bot to each of those servers with the same URL.

5. Put the bot's role high enough #

In Discord: Server Settings → Roles, drag the bot's role above every role it must give. A bot can never give a role placed higher than its own, or at the same rank.

Server Settings, Roles: the Agora bot role at the very top, above the roles it gives

Agora checks this for you: a role that is too high is greyed out in the lists, with the reason, and refused on save. If you reorder roles later, a mapping that became impossible shows in red in Administration → Configuration → Discord connection, under Mappings Discord will refuse.

6. Copy the server ID #

  1. Discord → User Settings → Advanced (Developer in recent versions) → turn on Developer Mode.

The Developer Mode setting turned on

  1. Right-click your server → Copy Server ID.

The server right-click menu, with Copy Server ID at the bottom

Discord's official help covers this step: Where can I find my User/Server/Message ID?.

Tip, desktop app only. With this ID, you can paste discord://-/guilds/ID/settings/roles into your browser's address bar (replacing ID with the server ID) to open Server Settings → Roles from step 5 directly. It is an unofficial shortcut: it may stop working, and the menu path always works. To understand role hierarchy, see Discord Roles and Permissions.

7. Connect the bot to Agora #

  1. Administration → Configuration → Discord connection, block Discord bot (roles + messages).
  2. Paste the Bot token and the Server (guild) ID, then Save.
  3. The banner turns to "● Bot connected: name on server · N role(s) visible". The token stays hidden ("configured"): leave the field empty to keep it.

The Discord bot (roles + messages) block: "Bot connected" banner, hidden token marked configured, server ID

  1. Click Test: Agora checks the token, the server and what Discord would refuse on the next sync, without changing anything on Discord.

The Test the Discord setup block and its Test button

Then link each site role to a Discord role in Discord roles linked to roles: see Connect Discord to Agora: sign-in, bot and roles.

The Discord roles linked to roles section: each site role with the Discord role picked from the list

You know it worked when… #

  • The banner shows "● Bot connected: …" and the Test button reports no problem.
  • When an application is decided, the applicant receives a private message from the bot (if their private messages are open).

<!-- CAPTURE C-029 -->

If it does not work #

  • "Bot not connected": token copied wrong (extra space) or reset since. Redo step 3.
  • The bot is not on the server: the invite URL from step 4 was not confirmed, or Requires OAuth2 Code Grant is on.
  • A role is not given: the bot's role is too low (step 5) or the Manage Roles permission is missing. See Missing Discord permission.

Go further #

Was this article helpful?