Configurer Hermes Agent sur Discord

Configurer Hermes Agent sur Discord

Cette page fait partie du guide pratique francophone consacré à Hermes Agent. Elle répond à l'intention de recherche : créer un bot Discord.

Le contenu s'appuie sur la documentation officielle Hermes Agent associée à cette page. L'objectif n'est pas de remplacer la documentation de Nous Research, mais de fournir une lecture claire en français, structurée pour aller vite, avec un maillage logique vers les pages complémentaires du même site.

À retenir

  • Sujet principal : hermes agent discord.
  • Type de page : spoke.
  • Cluster : messagerie.
  • Source canonique : documentation officielle Hermes Agent.
  • Aucun lien vers l'autre domaine n'est utilisé dans cette page.

Quand utiliser cette page

Utilisez cette page quand vous voulez créer un bot Discord. Elle part du principe que Hermes Agent est déjà identifié comme l'outil à mettre en place ou à comprendre, puis détaille les points importants issus de la documentation officielle.

Si vous découvrez seulement l'outil, revenez d'abord au hub parent puis suivez les liens internes proposés en fin de page.

Base officielle

Hermes Agent integrates with Discord as a bot, letting you chat with your AI assistant through direct messages or server channels. The bot receives your messages, processes them through the Hermes Agent pipeline (including tool use, memory, and reasoning), and responds in real time. It supports text, voice messages, file attachments, and slash commands.

Before setup, here's the part most people want to know: how Hermes behaves once it's in your server.

How Hermes Behaves

  • Context — Behavior
  • DMs — Hermes responds to every message. No @mention needed. Each DM has its own session.
  • Server channels — By default, Hermes only responds when you @mention it. If you post in a channel without mentioning it, Hermes ignores the message.
  • Free-response channels — You can make specific channels mention-free with DISCORD_FREE_RESPONSE_CHANNELS, or disable mentions globally with DISCORD_REQUIRE_MENTION=false. Messages in these channels are answered inline — auto-threading is skipped so the channel stays a lightweight chat.
  • Threads — Hermes replies in the same thread. Mention rules still apply unless that thread or its parent channel is configured as free-response. Threads stay isolated from the parent channel for session history.
  • Shared channels with multiple users — By default, Hermes isolates session history per user inside the channel for safety and clarity. Two people talking in the same channel do not share one transcript unless you explicitly disable that.
  • Messages mentioning other users — When DISCORD_IGNORE_NO_MENTION is true (the default), Hermes stays silent if a message @mentions other users but does not mention the bot. This prevents the bot from jumping into conversations directed at other people. Set to false if you want the bot to respond to all messages regardless of who is mentioned. This only applies in server channels, not DMs.

If you want a normal bot-help channel where people can talk to Hermes without tagging it every time, add that channel to DISCORD_FREE_RESPONSE_CHANNELS.

Discord Gateway Model

Hermes on Discord is not a webhook that replies statelessly. It runs through the full messaging gateway, which means each incoming message goes through:

  1. authorization (DISCORD_ALLOWED_USERS)
  2. mention / free-response checks
  3. session lookup
  4. session transcript loading
  5. normal Hermes agent execution, including tools, memory, and slash commands
  6. response delivery back to Discord

That matters because behavior in a busy server depends on both Discord routing and Hermes session policy.

Session Model in Discord

By default:

  • each DM gets its own session
  • each server thread gets its own session namespace
  • each user in a shared channel gets their own session inside that channel

So if Alice and Bob both talk to Hermes in #research, Hermes treats those as separate conversations by default even though they are using the same visible Discord channel.

This is controlled by config.yaml:

group_sessions_per_user: true

Set it to false only if you explicitly want one shared conversation for the entire room:

group_sessions_per_user: false

Shared sessions can be useful for a collaborative room, but they also mean:

  • users share context growth and token costs
  • one person's long tool-heavy task can bloat everyone else's context
  • one person's in-flight run can interrupt another person's follow-up in the same room

Interrupts and Concurrency

Hermes tracks running agents by session key.

With the default group_sessions_per_user: true:

  • Alice interrupting her own in-flight request only affects Alice's session in that channel
  • Bob can keep talking in the same channel without inheriting Alice's history or interrupting Alice's run

With group_sessions_per_user: false:

  • the whole room shares one running-agent slot for that channel/thread
  • follow-up messages from different people can interrupt or queue behind each other

This guide walks you through the full setup process — from creating your bot on Discord's Developer Portal to sending your first message.

Step 1: Create a Discord Application

  1. Go to the Discord Developer Portal and sign in with your Discord account.
  2. Click New Application in the top-right corner.
  3. Enter a name for your application (e.g., "Hermes Agent") and accept the Developer Terms of Service.
  4. Click Create.

You'll land on the General Information page. Note the Application ID — you'll need it later to build the invite URL.

Step 2: Create the Bot

  1. In the left sidebar, click Bot.
  2. Discord automatically creates a bot user for your application. You'll see the bot's username, which you can customize.
  3. Under Authorization Flow:

- Set Public Bot to ON — required to use the Discord-provided invite link (recommended). This allows the Installation tab to generate a default authorization URL.

- Leave Require OAuth2 Code Grant set to OFF.

You can set a custom avatar and banner for your bot on this page. This is what users will see in Discord.

If you prefer to keep your bot private (Public Bot = OFF), you must use the Manual URL method in Step 5 instead of the Installation tab. The Discord-provided link requires Public Bot to be enabled.

Step 3: Enable Privileged Gateway Intents

This is the most critical step in the entire setup. Without the correct intents enabled, your bot will connect to Discord but will not be able to read message content.

On the Bot page, scroll down to Privileged Gateway Intents. You'll see three toggles:

  • Intent — Purpose — Required?
  • Presence Intent — See user online/offline status — Optional
  • Server Members Intent — Access the member list, resolve usernames — Required
  • Message Content Intent — Read the text content of messages — Required

Enable both Server Members Intent and Message Content Intent by toggling them ON.

  • Without Message Content Intent, your bot receives message events but the message text is empty — the bot literally cannot see what you typed.
  • Without Server Members Intent, the bot cannot resolve usernames for the allowed users list and may fail to identify who is messaging it.

If your bot is online but never responds to messages, the Message Content Intent is almost certainly disabled. Go back to the Developer Portal, select your application → Bot → Privileged Gateway Intents, and make sure Message Content Intent is toggled ON. Click Save Changes.

Regarding server count:

  • If your bot is in fewer than 100 servers, you can simply toggle intents on and off freely.
  • If your bot is in 100 or more servers, Discord requires you to submit a verification application to use privileged intents. For personal use, this is not a concern.

Click Save Changes at the bottom of the page.

Step 4: Get the Bot Token

The bot token is the credential Hermes Agent uses to log in as your bot. Still on the Bot page:

  1. Under the Token section, click Reset Token.
  2. If you have two-factor authentication enabled on your Discord account, enter your 2FA code.
  3. Discord will display your new token. Copy it immediately.

The token is only displayed once. If you lose it, you'll need to reset it and generate a new one. Never share your token publicly or commit it to Git — anyone with this token has full control of your bot.

Store the token somewhere safe (a password manager, for example). You'll need it in Step 8.

Step 5: Generate the Invite URL

You need an OAuth2 URL to invite the bot to your server. There are two ways to do this:

Option A: Using the Installation Tab (Recommended)

This method requires Public Bot to be set to ON in Step 2. If you set Public Bot to OFF, use the Manual URL method below instead.

  1. In the left sidebar, click Installation.
  2. Under Installation Contexts, enable Guild Install.
  3. For Install Link, select Discord Provided Link.
  4. Under Default Install Settings for Guild Install:

- Scopes: select bot and applications.commands

- Permissions: select the permissions listed below.

Option B: Manual URL

You can construct the invite URL directly using this format:

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

Replace YOUR_APP_ID with the Application ID from Step 1.

Required Permissions

These are the minimum permissions your bot needs:

  • View Channels — see the channels it has access to
  • Send Messages — respond to your messages
  • Embed Links — format rich responses
  • Attach Files — send images, audio, and file outputs
  • Read Message History — maintain conversation context

Recommended Addit

Points de vigilance

  • Vérifiez toujours la version active de Hermes Agent avant d'appliquer une commande ou une configuration.
  • Ne collez pas de clé API dans un chat public ou dans une page visible.
  • Gardez les secrets dans les fichiers ou gestionnaires prévus pour cela.
  • Si une fonctionnalité dépend d'un provider, d'un plugin ou d'une plateforme de messagerie, vérifiez que le composant est bien activé dans votre profil.
  • Pour une installation de production, testez d'abord le flux complet sur une machine ou un profil isolé.

Exemple de parcours logique

  1. Lire la page courante pour comprendre hermes agent discord.
  2. Ouvrir le hub parent du cluster messagerie.
  3. Passer ensuite aux pages complémentaires proposées dans « À lire ensuite ».
  4. Revenir à la documentation officielle si vous avez besoin du détail exact ou d'une commande récemment modifiée.

FAQ rapide

Cette page remplace-t-elle la documentation officielle ?

Non. Elle sert de guide francophone structuré. Le lien vers la source officielle est disponible en bas de page.

Les commandes sont-elles garanties à jour ?

Elles sont basées sur la documentation officielle récupérée au moment de la génération. Pour un usage critique, vérifiez toujours la page officielle liée en bas.

Pourquoi autant de liens internes ?

Hermes Agent est un système modulaire. L'installation, les providers, les outils, la mémoire, les skills, la sécurité et les plateformes se répondent. Le maillage interne aide à suivre ce chemin sans tomber sur des pages orphelines.