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
Open the Discord Developer Portal, press New Application, name it and press Create. Note the Application ID on the General Information page.
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.
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.
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:
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
In Discord, open Settings, Advanced, and turn on Developer Mode.
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.
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.
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.
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.
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
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:
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 see
Cause and fix
The bot stays offline; the log mentions privileged Gateway Intents
Message 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 channel
In 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 everywhere
The 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.
We use cookies to keep the site working, to understand how it is used, and to measure our marketing. You can accept all, accept essential cookies only, or choose per category.We use cookies to keep the site working, to understand how it is used, and to measure our marketing. They are on by default here. You can switch off anything you do not want.Read our privacy policy