← Back to Starter kits
Discord setup 13 steps

Add your agent to Discord

Make a Discord bot, connect it to your agent, and choose where it can reply. This guide uses my-trainer as an example. Use your own agent's name.

Make the bot in Discord

First, make the bot and copy the private token that connects it to your agent.

  1. 1

    Create the application

    Open the Discord Developer Portal and select New Application. Give it the same name as your agent, such as my-trainer, then select Create.

    If you already made an application for this agent, open that one instead.

  2. 2

    Open the Bot page

    Select Bot in the left sidebar. New applications usually include a bot already. If you see Add Bot or Create Bot, select it.

  3. 3

    Turn on both settings under "Privileged Gateway Intents"

    On the Bot page, scroll to "Privileged Gateway Intents". Turn on Server Members Intent and Message Content Intent, then select Save Changes.

    Server Members Intent lets Agent Control show the people in your server. Message Content Intent lets your agent read a regular message without an @mention.

    Server Members Intent and Message Content Intent switched on in Discord
    Turn on both switches, then save the change.
  4. 4

    Keep a personal bot private

    Do these settings in order. Select Installation in the sidebar. Under Install Link, choose None and save. Go back to Bot, turn off Public Bot, and save again.

    Now only the application owner can add the bot to a server. You will choose who can read and talk to the agent later.

    Discord Installation page with Install Link set to None
    Set Install Link to None before you turn off Public Bot.
    If Discord will not let you turn off Public Bot:

    Go back to Installation, set Install Link to None, and save. Then return to Bot and try again. Verified Discord applications must stay public.

  5. 5

    Reset and copy the bot token

    Still on the Bot page, find Token and select Reset Token. Complete Discord's password or two-factor check, then select Copy.

    Copy the bot token, not the Application ID, Public Key, or Client Secret. Discord will not show this token again. If you lose it, reset it and use the new one.

    Discord Bot page showing the Reset Token button
    Select Reset Token. Discord asks you to confirm before it shows the new token.
    Do not paste the token into chat, email, a support form, or a screenshot.

    If someone else sees it, reset it in Discord before you continue.

Connect it and add it to your server

First connect the bot account. Then add that bot to the Discord server where you want to talk to it.

  1. 6

    Paste the token into Agent Control

    In the Agent Control tab you just opened, paste the token under Discord bot token, then select Connect bot.

    Agent Control checks the token and restarts your agent. This usually takes about 30 seconds. When it works, you will see Discord connected and the bot's name.

    The token box clears after the check so your secret is not left on screen. You do not need to paste it again.

  2. 7

    Add the bot to your server

    Select Add my-trainer to a server. If the bot is private, make sure you are signed in to the Discord account that created it.

  3. 8

    Choose the server in Discord

    On Discord's approval screen:

    • Choose Add to server, not Add to my apps.
    • Select your server.
    • Select Continue.
    • Review the permissions, select Authorize, and complete the CAPTCHA.

    If your server is missing, check that you are signed in to the right Discord account and have Manage Server permission for that server.

  4. 9

    Create a private home channel

    In your Discord server, select Create Channel. Choose Text, name it my-trainer, turn on Private Channel, and create it. When Discord asks who can use the channel, add yourself and the bot.

    If you already created the channel, open it and choose Edit Channel > Permissions. For @everyone, deny View Channel. Add yourself and the bot as members. For the bot, allow View Channel, Send Messages, and Read Message History, then save.

  5. 10

    Return to Agent Control and choose the channel

    Go back to Agent Control and reload the page. Under Server, select the server you just added. Then choose #my-trainer as the Home channel.

    Check the channel name before you continue. Agent Control may preselect a different text channel.

Finish setup and test

Choose yourself and save the settings. Then make sure your agent replies.

  1. 11

    Choose yourself

    Under Your Discord account, choose yourself. Keep Just me selected. You can leave Optional: more channels and behavior closed. Home only is already selected.

  2. 12

    Save settings

    Select Save settings. The page confirms when your choices have been saved.

  3. 13

    Send one message without tagging it

    When Agent Control says Your bot is ready for a real message, select Open the home channel and send:

    hi

    Do not tag the bot. If your agent replies, the setup is complete.

What success looks like

Your agent replies in the private home channel

If it replies, Discord can deliver your message and the agent can answer in the channel you chose.

A personal setup has three privacy controls.

Each one protects a different part of the setup.

Private application

Install Link: None and Public Bot: off mean only the application owner can add the bot to a server.

Installation

Private channel

Discord channel permissions control who can read the conversation.

Conversation

Just me access

Agent Control decides who can talk to the agent and where it can reply.

Replies

Without Agent Control

Running Hermes yourself, on Agent37 or another machine? Make the bot and copy its token above, then paste the token in your agent's terminal instead of Agent Control. These steps follow the Hermes Discord guide.

  1. 1

    Copy your Discord user ID

    In Discord, open Settings, then Advanced, and turn on Developer Mode. Right-click your own name and choose Copy User ID. Hermes only answers the user IDs you give it.

  2. 2

    Paste the token in the terminal

    Open your agent's terminal. On Agent37, it is the >_ icon on the agent's page. Run hermes gateway setup, choose Discord, and paste the bot token and your user ID when it asks.

    The terminal is the only place the token goes. Never paste it into a chat with your agent.

  3. 3

    Add the bot to your server

    A private bot needs an invite link you make yourself. In the Developer Portal, open General Information and copy the Application ID. Put it in this link in place of YOUR_APP_ID, open the link, choose your server, and select Authorize.

  4. 4

    Make a private home channel

    Create a private text channel and add yourself and the bot, as in Step 9 above. Then type /sethome in that channel. Scheduled messages from your agent go to the home channel.

  5. 5

    Send one message

    Type @ and your bot's name, then hi. In a server channel, Hermes answers when you mention it.

    If the bot still shows as offline after a minute, restart the agent. On Agent37, restart it from the agent's page. Anywhere else, run hermes gateway restart in the terminal.

If something gets stuck

Start with the message you see

Find the problem below and check that setting first.

Public Bot will not turn off

Under Installation, set Install Link to None and save. Then go back to Bot, turn off Public Bot, and save again.

Discord

The token is rejected

Reset it on Discord's Bot page and copy the new bot token without spaces. Never send the token through the AgentMarkit contact form.

Token

No server appears

Reload Agent Control. If the server is still missing, confirm that you added the bot to the right server and that your Discord account has Manage Server permission.

Server

No people appear

In Discord, turn on Server Members Intent and save. Then reload Agent Control.

People

The bot cannot read or reply

Check Message Content Intent and the bot's channel permissions: View Channel, Send Messages, and Read Message History. Save, then try the message again.

Channel

You see Advanced channel rules

Select Discord settings at the top to return to the main setup. Advanced channel rules are only for giving one channel different instructions or reply behavior.

Agent Control

Discord references

Official help

Discord sometimes moves a setting or changes its name. These official pages explain the settings used here.