NEW 📢 Limited launch offer: up to 70% off your first month on every game!See plans

How to connect Hermes Agent to Discord

Hermes AgentUpdated Nov 7, 20267 min read

Short answer. Create an application and a bot in the Discord Developer Portal, turn on Message Content Intent and Server Members Intent, copy the bot token with Reset Token, invite the bot to your server, then give Hermes Agent the token and your Discord user ID. Only the IDs on its allowlist can talk to it. On your own machine that is DISCORD_BOT_TOKEN and DISCORD_ALLOWED_USERS in ~/.hermes/.env, or hermes gateway setup. On PlayNHost you paste the token and your ID on the Agent page and restart.

Checked on 7 November 2026, accurate for Hermes Agent v0.23.0.

This guide uses Hermes Agent's Discord and security documentation and the PlayNHost panel as it works today. Discord support is built into Hermes Agent's messaging gateway.

Step 1: create the application and the bot

  1. Open the Discord Developer Portal, press New Application, name it and press Create. Note the Application ID on the General Information page.
  2. Open Bot in the left menu. Under Authorization Flow, set Public Bot to on if you want Discord's own invite link (Step 2), and leave Require OAuth2 Code Grant off.
  3. Under Privileged Gateway Intents, turn on Message Content Intent and Server Members Intent, then press Save Changes. Hermes Agent's docs mark both as required: without Message Content Intent, Discord refuses the bot's connection and it never comes online. Presence Intent is optional.
  4. Under Token, press Reset Token and copy the token. Discord shows it once. Keep it private: anyone with it controls your bot.

Step 2: invite the bot to your server

Either use Installation (Guild Install, Discord Provided Link, scopes bot and applications.commands, and the permissions listed below), or build the link yourself with the Application ID from Step 1:

https://discord.com/oauth2/authorize?client_id=YOUR_APP_ID&scope=bot+applications.commands&permissions=309237763136

309237763136 is the permission set Hermes Agent's docs recommend: View Channels, Send Messages, Embed Links, Attach Files, Read Message History, Create Public Threads, Send Messages in Threads and Add Reactions. Open the link, pick your server and press Authorize. You need the Manage Server permission on that server.

Step 3: find your Discord user ID

  1. In Discord, open Settings, Advanced, and turn on Developer Mode.
  2. Right-click your own name and choose Copy User ID. It is a long number, such as 284102345871466496.

This is your user ID, not the bot's Application ID and not a server or channel ID.

Step 4 on PlayNHost: paste the token and your ID

  1. Open your server at panel.playnhost.com, then the Agent tab.
  2. Under AI provider, set one key if you have not yet (see which AI provider key to use).
  3. Under Chat apps, press Set on Discord bot token, paste the token and press Save. The row then shows only the last four characters; the token is never shown again.
  4. Under Who can message it, paste your ID into Discord user IDs and press Save. Several IDs go on one line, separated by commas or spaces.
  5. Press Start, or Restart now if the agent is already running ("Changes apply the next time your agent starts."). When it is up, the console confirms:
    [PlayNHost] Your agent is running
    [PlayNHost] Discord: only user 284102345871466496 can message your agent.
  6. Send the bot a direct message, or @mention it in a channel it can see. Your agent answers: in a direct message right there, in a channel in a new thread under your message.

If you start with an empty Discord user IDs field, the console says "Discord: nobody can message your agent yet" and asks you to send the bot a message: a direct message from someone not on the list is ignored, and the console then prints a line with that sender's ID to add. Developer Mode is the quicker way.

Telegram and Discord can run on the same agent at the same time: set both tokens and both ID lists.

How Hermes Agent behaves in Discord

  • Direct messages: it answers every message, no mention needed, one conversation per DM.
  • Server channels: it answers only when you @mention it, and by default it opens a new thread for each mention and answers there. Different people in one channel get separate conversations.
  • Other people: on PlayNHost, only the user IDs on the Agent page are answered. Role grants, allow-all switches and bot-to-bot access are switched off at each start.

Step 4 on your own machine

  1. Run the setup wizard and choose Discord. Hermes Agent's docs say it checks the token with Discord, checks the intents, prints the invite link and offers to allow you:
    hermes gateway setup
  2. Or add the values to ~/.hermes/.env by hand:
    DISCORD_BOT_TOKEN=your-bot-token
    DISCORD_ALLOWED_USERS=284102345871466496
  3. Start it with hermes gateway. For a gateway that keeps running after you log out, see how to run Hermes Agent 24/7.

When it does not answer

What you seeCause and fix
The bot stays offline; the log mentions privileged Gateway IntentsMessage Content Intent is off. Turn it on in the Developer Portal (Bot, Privileged Gateway Intents), press Save Changes, then restart the agent.
Console: "Discord refused the bot token. Check it on the Agent page, then restart."The token was reset or mistyped. Press Reset Token in the Developer Portal and paste the new one with Replace.
Console: "Your agent could not connect to Discord (see the lines above)"Read the lines above it. Check both intents first, then restart.
Online, but no answer in a channelIn server channels it answers only when you @mention it, and only if it can see the channel. Look for a new thread under your message: that is where it answers.
Online, but it ignores you everywhereThe ID on the list is not yours (often the Application ID). Copy your own with Copy User ID, save it and restart.
Console: "... entry in the Discord user IDs is not a Discord user ID and was left out"A number on the list is shorter than 5 or longer than 25 digits. Copy it again from Discord.

On PlayNHost, Hermes Agent's own log is .hermes/logs/gateway.log in Files. Want Telegram too? See connect Hermes Agent to Telegram. Not set up yet? Create a Hermes Agent server.

PlayNHost is not affiliated with Nous Research. Hermes Agent is open-source software under the MIT licence.

Already hosting it somewhere else? Move your server to us

OUR LATEST BLOGS