Bablo ResourcesDocs

Your Own Discord Bot

Bablo Admin can use a Discord bot of your own for two things:

FeatureDoes the bot have to be in your Discord server?
Staff profile pictures from DiscordNo. Any bot token works.
Discord role syncYes. The bot reads the roles of your members.

This is a different bot from the shared Bablo Admin bot that runs the slash commands. That one you add from the web panel and it needs nothing in server.cfg.

Without your own bot everything else still works. Staff then show Discord’s default avatar, and role sync stays off.

1. Create the application

  1. Open the Discord Developer Portal and sign in with your Discord account.

  2. Click New Application in the top right.

    The New Application button in the Discord Developer Portal

  3. Give it a name, for example the name of your server. Players never see it. Tick the box to accept Discord’s terms and click Create.

    Name the application, tick the terms box and click Create

A new bot is public, so anyone with its link could add it to their server. Make it private so only you can:

  1. Open Installation in the menu on the left. Under Install Link, pick None and click Save Changes. Discord doesn’t let a private bot keep its own install link, so this has to come first.

    Install Link set to None

  2. Open Bot in the menu on the left, turn off Public Bot and click Save Changes.

    The Bot page with Public Bot turned off

You don’t need any of the Privileged Gateway Intents further down that page. Leave them off.

3. Copy the bot token

  1. On the same Bot page, click Reset Token and confirm. Discord may ask for your two-factor code.
  2. Click Copy. Discord shows the token only once, so paste it somewhere safe right away.

The token is the password of your bot. Never share it, never post it in a ticket and never put it in config.lua.

4. Add the token to server.cfg

Add this line above ensure bablo-admin and restart the server:

PLAINTEXT
set bablo_admin_discord_token "your bot token"

Use set, never setr. With setr every player could read your token.

That’s all you need for staff profile pictures. Each staff member’s picture is fetched from Discord when they join.

5. Invite the bot to your Discord server (role sync only)

Skip this step if you only want profile pictures.

  1. Open OAuth2 in the menu on the left and scroll down to OAuth2 URL Generator.

  2. Tick bot under Scopes.

    Tick bot under Scopes

  3. A Bot Permissions list appears below. Leave it all empty: the bot only reads roles, it never changes anything in your Discord.

  4. Leave Integration Type on Guild Install, copy the Generated URL at the bottom with the copy button and open it in your browser.

    Copy the Generated URL

  5. Pick your Discord server and click Authorize.

Then link your roles to ranks and turn role sync on, as described in Discord role sync.

Check that it works

  • The server console prints nothing about the Discord token after the restart.
  • In game, Your settings → Discord shows no red error.
  • Staff who join get their Discord picture in the admin menu.
Discord refused the bot token
The token is wrong or was reset. Reset it again on the Bot page, paste the new one in server.cfg and restart the server. Until the token changes, Bablo Admin stops asking Discord with the refused one.
The bot can’t see that server
The bot isn’t in your Discord server yet (step 5), or the server ID in Your settings → Discord is wrong. Right-click your server icon in Discord and click Copy Server ID to get the right one.
Can Discord rate limit my server?
Bablo Admin spaces its requests out: one profile picture per second, one role check every 0.3 seconds and each player at most once every 10 minutes. That stays far below Discord’s limits. If Discord ever asks it to slow down, it waits as long as Discord says and tries again.