Discord Gateway Setup

What this page covers

This page covers the official Hermes Discord gateway path: create a Discord application and bot, enable privileged intents, invite it with the right scopes and permissions, configure Hermes, then verify DMs and server-channel behavior.

Hermes changes quickly, so treat the official documentation as the source of truth and use the built-in CLI to inspect the local install before editing config by hand.

Fast path

```bash

hermes gateway setup

```

```bash

hermes gateway run

```

```bash

hermes gateway status

```

```bash

hermes gateway restart

```

```bash

hermes config set discord.require_mention true

```

```bash

hermes config set discord.free_response_channels "123456789012345678"

```

Practical checklist

  • In Discord Developer Portal, enable both Server Members Intent and Message Content Intent; Message Content Intent is the most common reason a bot connects but cannot respond.
  • Use `bot` and `applications.commands` scopes when inviting the bot.
  • Store `DISCORD_BOT_TOKEN` and `DISCORD_ALLOWED_USERS` / `DISCORD_ALLOWED_ROLES` in `.env` via setup; do not commit or paste tokens.
  • By default, DMs respond to every message and server channels require `@mention`.
  • Use `DISCORD_FREE_RESPONSE_CHANNELS` or `discord.free_response_channels` only for channels that should be mention-free.
  • Keep `group_sessions_per_user: true` unless you intentionally want a shared room transcript.

Common pitfalls

  • Leaving Message Content Intent disabled.
  • Allowing all users or all bot messages without a clear moderation boundary.
  • Disabling mention requirements globally when only one help channel should be free-response.
  • Forgetting that cron/proactive delivery needs a home channel.

Verification checklist

  • Gateway logs show Discord connected without token errors.
  • The bot answers a DM from an allowed user.
  • In a server channel, it answers when mentioned and stays silent when not mentioned, unless the channel is configured free-response.
  • `/status` or gateway status reports the expected platform/session.

Official reference

https://hermes-agent.nousresearch.com/docs/user-guide/messaging/discord/