Lesson 4 of 6
Make it always-on: wire Hermes into Discord
Create a Discord bot, enable the right intents, and have Hermes reply to your DMs from any device.
Running hermes in a terminal tab is useful. Having your agent reply to a DM from your phone while your laptop is in a bag is something different.
This lesson sets up the Discord integration — Hermes's most beginner-friendly messaging platform. By the end, you can DM your bot from any device and get a response.
Create the Discord application
- Go to discord.com/developers/applications
- Click New Application → enter a name → accept the terms → Create
- In the left sidebar, click Bot
- Set Public Bot to ON under Authorization Flow
Enable the required intents
This is the step most people miss. On the Bot page, scroll to Privileged Gateway Intents and toggle both of these ON:
- ✅ Server Members Intent — lets Hermes resolve usernames
- ✅ Message Content Intent — lets Hermes read the text of messages
Message Content Intent is the #1 gotcha. If your bot is online but never responds to messages, this intent is almost certainly disabled. Without it, Hermes receives message events but the text field is empty — it can't see what you wrote.
Get your bot token
On the Bot page, click Reset Token. Complete 2FA if prompted. Copy the token immediately — it's only shown once.
Never share your token publicly or commit it to a git repo. If you accidentally expose one, go back to the Bot page and reset it immediately.
Invite the bot to your server
- Click the Installation tab in the left sidebar
- Enable Guild Install
- Select Discord Provided Link
- Choose scopes: bot and applications.commands
- Under permissions, select: View Channels, Send Messages, Embed Links, Attach Files, Read Message History
- Open the generated invite URL → select your server → Authorize
You'll need a Discord server you own or admin. A private one-person server works fine for testing.
Find your Discord user ID
In Discord: Settings → Advanced → Developer Mode → ON. Then right-click your username anywhere and click Copy User ID. Save it — you'll paste it into Hermes in the next step.
Configure the gateway
hermes gateway setup
Select Discord from the list. Paste your bot token and your user ID when prompted. Hermes writes these to ~/.hermes/.env — they're never in a config file you'd accidentally commit.
The config ends up as two lines in ~/.hermes/.env:
DISCORD_BOT_TOKEN=your-bot-token
DISCORD_ALLOWED_USERS=your-user-id
Only users in DISCORD_ALLOWED_USERS (or DISCORD_ALLOWED_ROLES) can talk to the bot. Without this, the gateway denies everyone.
Start the gateway
hermes gateway run
You should see the bot come online in your Discord server. Open a DM with it and send a message:
What can you do for me right now? Give me a one-paragraph answer that shows your personality.
If Hermes replies with a response that matches your SOUL.md tone, the integration is working.
Make it persist across reboots
Right now the gateway stops when you close the terminal. To run it as a background service:
hermes gateway install
On macOS this registers a launchd agent. On Linux it registers a systemd service. Either way, the gateway starts automatically on boot and restarts if it crashes.
hermes gateway status # confirm it's running
Slash commands vs DMs
Hermes supports both. In DMs it always responds. In server channels it responds when you @mention it by default.
Skills automatically register as slash commands — after installing a skill, it appears in Discord's / menu. Built-in slash commands include /model, /reset, /background, and /sethome.
A note on always-on
If Hermes is running on your laptop, the gateway is down whenever your laptop sleeps. For true always-on, run this on a VPS. Hostinger's marketplace has a Hermes one-click install — spin up a KVM2 VPS (Ubuntu 24.04 LTS), install Hermes, run hermes gateway setup, then hermes gateway install. From that point your bot replies from any device, any time, regardless of what your laptop is doing.
The next lesson teaches Hermes new capabilities with skills and MCP servers.