Connect Discord to Agora: sign-in, bot and roles
Discord sign-in is mandatory; the bot, optional, assigns your groups' Discord roles and sends private messages.
Updated on Oct 4, 2026, 5:45 p.m.
On this page
In short. Your Discord application does two things. Sign-in (mandatory) lets your members sign in to your Hub with their Discord account. The bot (optional) automatically gives the right Discord role when a member joins a group, and sends a private message when their application is decided.
Before you start #
- The getting-started setup is done: your Discord application already exists.
- You are an administrator of the Hub (your Agora site). To change the sign-in ID and secret, you must also be the installation's owner.
- To invite the bot, you have the Manage Server permission on your Discord server.
- A word stops you? It is explained in the glossary.
Sign-in (OAuth), already set during setup #
OAuth is the standard way of "signing in with Discord": Discord tells Agora who the member is, with no password to create.
It is set during the getting-started setup. You find it again in Administration → Configuration → Discord connection, Discord login (OAuth) block: Client ID (your application's public identifier) and Client Secret (its secret). The value saved here applies without a restart.
<!-- CAPTURE C-020 -->
Agora asks Discord for two permissions, identify (your name, avatar and identifier) and email (your email), nothing else: a member's presence on your Discord server is checked by the bot, not by their sign-in.
Only the installation's owner can change this application's ID and secret, because it decides who can sign in to the site. The bot can be set by any administrator. See Manage members.
The redirect URL must be declared at Discord character for character: same protocol, same host, same port. Discord accepts
http://and IP addresses. See Discord sign-in fails.
Connect the bot (optional) #
Without the bot, everything works; only role synchronization is off. Each step below is detailed, with screenshots, in Create and set up your Discord bot.
- In the Discord developer portal, open the same application, Bot tab, then Reset Token. Copy the bot token, a secret shown only once.
- Still in Bot, turn on Server Members Intent. This is the switch that lets the bot see your Discord server's member list.
- Invite the bot: OAuth2 → URL Generator, tick the
botscope and the Manage Roles permission, then open the generated URL and pick your server. - In Discord: Server Settings → Roles, drag the bot's role above every role it must give.
- Copy the server ID: User Settings → Advanced → Developer Mode, then right-click the server and Copy Server ID (Discord's official help).
- In Agora, Administration → Configuration → Discord connection, Discord bot (roles + messages) block: paste the Bot token and the Server (guild) ID, then Save.
The banner changes to "● Bot connected: name on server · N role(s) visible". The Test button checks the token, the server and what Discord would refuse at the next synchronization (bot role too low, deleted role…), without changing anything on Discord.
Link each site role to a Discord role #
Once the bot is connected, the Discord roles linked to roles section unlocks.
- For each site role (Whitelist, Police…), pick the Discord role in the list.
- Save.
From now on, giving a site role to a member (accepted application or an administrator's action) also gives them the Discord role. Removing the site role removes the Discord role.
A role the bot cannot give (placed above its own, or managed by an integration) is greyed out with the reason and refused on save. If you reorder roles later, the red Mappings Discord will refuse list shows it, with an Open in the Discord app button to fix it.
<!-- CAPTURE C-021 -->
You know it worked when… #
- The banner shows "● Bot connected: …".
- The Test button answers "No problem: role sync can work".
- You give a site role to a test account and it receives the matching Discord role.
If it does not work #
| What you see | Likely cause |
|---|---|
| "○ Bot not connected" | Token badly copied (extra space) or regenerated since: redo step 1 |
| The bot is not on your Discord server | The invite URL was not completed, or Requires OAuth2 Code Grant is turned on in the portal |
| A role is not given | Bot role placed too low, or Manage Roles permission missing: see Missing Discord permission |
| A role is greyed out in the list | It is above the bot's role, or managed by an integration (Nitro boost, another bot): such a role cannot be assigned |
| Discord refuses members' sign-in | See Discord sign-in fails |
Go further #
The other way round. For a group whose roles are already managed in Discord (another bot, a subscriber role), tick Sync Discord → Agora under its mapping: a member who receives the role on Discord enters the group, one who loses it leaves. This listening needs Server Members Intent (step 2); without it, Agora falls back on the audit log and the bot's role needs the View Audit Log permission. Everything is explained in Discord roles, sync and "Suspended member".
Suspended member. The Suspended member setting decides what happens to a suspended member's Discord roles: keep them (the default), remove them during the suspension, or remove them and refuse their connection to the game server.
<!-- CAPTURE C-022 -->
The golden rule. A bot can never give a role placed higher than its own: it is the first cause of failure.
Was this article helpful?
Related articles
- Do the getting-started setup: key, Discord application, administratorOn the first start, every address leads to the getting-started screen: license key, Discord application, then your account becomes administrator.
- Create and set up your Discord bot, step by stepCreate the bot in the Discord portal, set its options, invite it to your server and connect it to Agora.
- Discord roles, sync and "Suspended member"Each group can carry a Discord role, set and removed automatically (or, if you prefer, Discord is the source of truth); the Suspended member setting decides what happens to roles during a suspension.
- Discord: role not given, missing permission, bot role too lowWhen a role does not arrive, it is almost always the bot's role sitting below the role to give, or the Manage Roles permission missing.
- Discord sign-in fails (redirect_uri, no Administration)redirect_uri mismatch comes from a callback URL that does not match character for character; no Administration entry, from a sign-in made outside getting started.