Skip to content

The agent that grows with you

feat(discord): setup checks the bot token with Discord and prints the invite link

teknium14c4ad0d3871f
diff --git a/.env.example b/.env.example
index 649da1879a6..1018fc5c6a0 100644
--- a/.env.example
+++ b/.env.example
@@ -370,6 +370,24 @@ BROWSER_INACTIVITY_TIMEOUT=120
# Get at: https://platform.openai.com/api-keys
# VOICE_TOOLS_OPENAI_KEY=
+# =============================================================================
+# DISCORD INTEGRATION
+# =============================================================================
+# Easiest path: `hermes gateway setup` → Discord. It checks the token with Discord,
+# tells you if Message Content Intent is off, prints the invite link for your
+# server, and allowlists you (the bot's owner) without needing Developer Mode.
+# Guide: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/discord
+#
+# Bot Token - https://discord.com/developers/applications → your app → Bot → Reset Token
+# (Also on the Bot page: turn ON "Message Content Intent", or the bot sees blank messages.)
+# DISCORD_BOT_TOKEN=
+# DISCORD_ALLOWED_USERS= # Comma-separated Discord user IDs (or usernames)
+# DISCORD_ALLOWED_ROLES= # Optional: comma-separated role IDs (anyone with the role)
+# DISCORD_HOME_CHANNEL= # Channel ID for cron delivery (or type /set-home in Discord)
+#
+# Invite the bot to your server (replace YOUR_APP_ID with the Application ID):
+# https://discord.com/oauth2/authorize?client_id=YOUR_APP_ID&scope=bot+applications.commands&permissions=309240908864&integration_type=0
+
# =============================================================================
# SLACK INTEGRATION
# =============================================================================
diff --git a/plugins/platforms/discord/adapter.py b/plugins/platforms/discord/adapter.py
index c8c0c2496aa..8228bdf1a96 100644
--- a/plugins/platforms/discord/adapter.py
+++ b/plugins/platforms/discord/adapter.py
@@ -7220,126 +7220,6 @@ async def _standalone_send(
# ── Plugin entry point ────────────────────────────────────────────────────────
-def _clean_discord_user_ids(raw: str) -> list:
- """Strip common Discord mention prefixes from a comma-separated ID string."""
- cleaned = []
- for uid in raw.replace(" ", "").split(","):
- uid = uid.strip()
- if uid.startswith("<@") and uid.endswith(">"):
- uid = uid.lstrip("<@!").rstrip(">")
- if uid.lower().startswith("user:"):
- uid = uid[5:]
- if uid:
- cleaned.append(uid)
- return cleaned
-
-
-def _discord_token_shape_error(token: str) -> Optional[str]:
- """Reject a Discord bot token that is really the numeric application ID.
-
- Users routinely paste the application ID from the Developer Portal's General
- Information page instead of the bot token (Bot page); the gateway then fails
- at runtime with an opaque 401. A real bot token is dot-separated base64 and
- never purely numeric, so this is a safe, narrow shape check (port of
- openclaw/openclaw#140531).
- """
- if token and token.strip().isdigit():
- return ("That looks like a numeric application ID, not a bot token. "
- "Paste the bot token from the Discord Developer Portal (Bot page), "
- "not the application ID (General Information page).")
- return None
-
-
-def _prompt_discord_bot_token(prompt) -> str:
- """Prompt for the bot token, re-prompting once when the answer is a numeric app ID."""
- from hermes_cli.cli_output import print_error
- token = ""
- for _attempt in range(2):
- token = prompt("Discord bot token", password=True)
- if not token:
- return ""
- error = _discord_token_shape_error(token)
- if error is None:
- return token
- print_error(error)
- # Second consecutive numeric answer: trust the user, keep the value.
- return token
-
-
-def interactive_setup() -> None:
- """Guide the user through Discord bot setup: token, allowlist, home channel (lazy CLI imports)."""
- from hermes_cli.config import get_env_value, remove_env_value, save_env_value
- from hermes_cli.cli_output import (
- prompt, prompt_yes_no, print_header, print_info, print_success,
- )
- from hermes_cli.setup_platforms import declines_reconfigure
- def _info_lines(*lines: str) -> None:
- for line in lines:
- print_info(line)
-
- def _save_allowlist(allowed_users: str) -> None:
- save_env_value("DISCORD_ALLOWED_USERS", ",".join(_clean_discord_user_ids(allowed_users)))
- print_success("Discord allowlist configured")
-
- print_header("Discord")
- if declines_reconfigure("Discord", "Reconfigure Discord?", "DISCORD_BOT_TOKEN"):
- if not get_env_value("DISCORD_ALLOWED_USERS"):
- print_info(
- "⚠️ Discord has no user allowlist. With the fail-closed default, "
- "messages are denied unless you configure allowed users, roles, "
- "or channels, or set DISCORD_ALLOW_ALL_USERS=true."
- )
- if prompt_yes_no("Add allowed users now?", True):
- print_info(" To find Discord ID: Enable Developer Mode, right-click name → Copy ID")
- allowed_users = prompt("Allowed user IDs (comma-separated)")
- if allowed_users:
- _save_allowlist(allowed_users)
- return
- _info_lines(
- "Create a bot at https://discord.com/developers/applications",
- "On Bot → Privileged Gateway Intents, enable:",
- " - Message Content Intent (required — without it Discord rejects the connection)",
- " - Server Members Intent (required if you use usernames or role allowlists)",
- "Save Changes in the Developer Portal before starting the gateway.",
- "Docs: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/discord",
- )
- token = _prompt_discord_bot_token(prompt)
- if not token:
- return
- save_env_value("DISCORD_BOT_TOKEN", token)
- print_success("Discord token saved")
- print()
- _info_lines(
- "🔒 Security: Restrict who can use your bot", " To find your Discord user ID:",
- " 1. Enable Developer Mode in Discord settings", " 2. Right-click your name → Copy ID",
- )
- print()
- print_info(" You can also use Discord usernames (resolved on gateway start).")
- print()
- allowed_users = prompt("Allowed user IDs or usernames (comma-separated, leave empty for open access)")
- if allowed_users:
- _save_allowlist(allowed_users)
- else:
- print_info(
- "⚠️ No allowlist set. Discord will deny messages until you set "
- "DISCORD_ALLOWED_USERS, DISCORD_ALLOWED_ROLES, DISCORD_ALLOWED_CHANNELS, "
- "or DISCORD_ALLOW_ALL_USERS=true for open access."
- )
- print()
- _info_lines(
- "📬 Home Channel: where Hermes delivers cron job results,",
- " cross-platform messages, and notifications.",
- " To get a channel ID: right-click a channel → Copy Channel ID",
- " (requires Developer Mode in Discord settings)",
- " You can also set this later by typing /set-home in a Discord channel.",
- )
- home_channel = prompt("Home channel ID (leave empty to set later with /set-home)").strip()
- if home_channel:
- save_env_value("DISCORD_HOME_CHANNEL", home_channel)
- elif remove_env_value("DISCORD_HOME_CHANNEL"):
- print_info("Home channel cleared.")
-
-
_YAML_BOOL_ENV_KEYS = (
("require_mention", "DISCORD_REQUIRE_MENTION"),
("thread_require_mention", "DISCORD_THREAD_REQUIRE_MENTION"),
@@ -7459,6 +7339,8 @@ _is_connected = _env_is_connected("DISCORD_BOT_TOKEN")
def register(ctx) -> None:
"""Plugin entry point — called by the Hermes plugin system."""
+ from plugins.platforms.discord.onboarding import interactive_setup
+
ctx.register_platform(
name="discord",
label="Discord",
diff --git a/plugins/platforms/discord/onboarding.py b/plugins/platforms/discord/onboarding.py
new file mode 100644
index 00000000000..b8648426d2a
--- /dev/null
+++ b/plugins/platforms/discord/onboarding.py
@@ -0,0 +1,295 @@
+"""Discord onboarding: check a bot token against Discord and walk the user through setup.
+
+The Developer Portal is where Discord setup goes wrong: a token copied from the wrong page, the
+Message Content Intent left off (the bot connects and sees empty messages), an invite URL built
+by hand, and Developer Mode just to learn your own user ID. ``GET /applications/@me`` with the
+bot token answers all of it at once — the token works, which intents are on, how many servers the
+bot is in, and who owns the application — so the CLI wizard and the dashboard/Desktop check route
+both read :func:`check_bot_token` instead of asking the user to verify those by hand.
+"""
+
+from __future__ import annotations
+
+from dataclasses import dataclass
+from typing import Optional
+from urllib.parse import urlencode
+
+# Every permission the adapter exercises (text, threads, reactions, voice). Named so the integer
+# in the invite link and the docs can be re-derived instead of trusted.
+INVITE_PERMISSION_BITS = {
+ "Add Reactions": 6,
+ "View Channels": 10,
+ "Send Messages": 11,
+ "Embed Links": 14,
+ "Attach Files": 15,
+ "Read Message History": 16,
+ "Connect": 20,
+ "Speak": 21,
+ "Create Public Threads": 35,
+ "Send Messages in Threads": 38,
+}
+INVITE_PERMISSIONS = sum(1 << bit for bit in INVITE_PERMISSION_BITS.values())
+_TEAM_MEMBER_ACCEPTED = 2
+
+
+@dataclass(frozen=True)
+class DiscordBotCheck:
+ app_id: str
+ bot_name: str
+ # (user_id, username): the application owner, or every accepted member of the owning team.
+ owners: tuple[tuple[str, str], ...]
+ message_content: bool
+ server_members: bool
+ server_count: Optional[int]
+
+ @property
+ def invite_url(self) -> str:
+ # integration_type=0 is a server install, so Discord skips the "add to server or to my
+ # apps?" question for applications that also allow user installs.
+ query = urlencode({"client_id": self.app_id, "scope": "bot applications.commands",
+ "permissions": INVITE_PERMISSIONS, "integration_type": 0})
+ return f"https://discord.com/oauth2/authorize?{query}"
+
+ @property
+ def bot_settings_url(self) -> str:
+ return f"https://discord.com/developers/applications/{self.app_id}/bot"
+
+ def as_payload(self) -> dict:
+ return {
+ "app_id": self.app_id, "bot_name": self.bot_name,
+ "owners": [{"id": uid, "username": name} for uid, name in self.owners],
+ "message_content": self.message_content, "server_members": self.server_members,
+ "server_count": self.server_count, "invite_url": self.invite_url,
+ "bot_settings_url": self.bot_settings_url,
+ }
+
+
+def _owners(app: dict) -> tuple[tuple[str, str], ...]:
+ team = app.get("team")
+ if isinstance(team, dict):
+ return tuple(
+ (str(m["user"]["id"]), str(m["user"].get("username") or m["user"]["id"]))
+ for m in team.get("members") or []
+ if m.get("membership_state") == _TEAM_MEMBER_ACCEPTED and m.get("user", {}).get("id")
+ )
+ owner = app.get("owner") or {}
+ return ((str(owner["id"]), str(owner.get("username") or owner["id"])),) if owner.get("id") else ()
+
+
+def check_bot_token(token: str) -> DiscordBotCheck:
+ """Read the application behind ``token``. Raises :class:`DiscordAPIError` (401 = bad token)
+ or ``OSError`` when Discord is unreachable."""
+ from tools.discord_tool import _FLAGS_GUILD_MEMBERS, _FLAGS_MESSAGE_CONTENT, _discord_request
+ app = _discord_request("GET", "/applications/@me", token.strip(), timeout=10)
+ flags = int(app.get("flags") or 0)
+ bot = app.get("bot") or {}
+ count = app.get("approximate_guild_count")
+ return DiscordBotCheck(
+ app_id=str(app["id"]),
+ bot_name=str(bot.get("username") or app.get("name") or app["id"]),
+ owners=_owners(app),
+ message_content=bool(flags & _FLAGS_MESSAGE_CONTENT),
+ server_members=bool(flags & _FLAGS_GUILD_MEMBERS),
+ server_count=count if isinstance(count, int) else None,
+ )
+
+
+# ── CLI wizard (hermes setup / hermes gateway setup) ─────────────────────────
+
+
+def _clean_discord_user_ids(raw: str) -> list:
+ """Strip common Discord mention prefixes from a comma-separated ID string."""
+ cleaned = []
+ for uid in raw.replace(" ", "").split(","):
+ uid = uid.strip()
+ if uid.startswith("<@") and uid.endswith(">"):
+ uid = uid.lstrip("<@!").rstrip(">")
+ if uid.lower().startswith("user:"):
+ uid = uid[5:]
+ if uid:
+ cleaned.append(uid)
+ return cleaned
+
+
+def _discord_token_shape_error(token: str) -> Optional[str]:
+ """Reject a Discord bot token that is really the numeric application ID.
+
+ Users routinely paste the application ID from the Developer Portal's General Information page
+ instead of the bot token (Bot page). A real bot token is dot-separated base64 and never purely
+ numeric, so this is a safe, narrow shape check (port of openclaw/openclaw#140531).
+ """
+ if token and token.strip().isdigit():
+ return ("That looks like a numeric application ID, not a bot token. "
+ "Paste the bot token from the Discord Developer Portal (Bot page), "
+ "not the application ID (General Information page).")
+ return None
+
+
+def _prompt_discord_bot_token(prompt) -> str:
+ """Prompt for the bot token, re-prompting once when the answer is a numeric app ID."""
+ from hermes_cli.cli_output import print_error
+ token = ""
+ for _attempt in range(2):
+ token = prompt("Discord bot token", password=True)
+ if not token:
+ return ""
+ error = _discord_token_shape_error(token)
+ if error is None:
+ return token
+ print_error(error)
+ # Second consecutive numeric answer: trust the user, keep the value.
+ return token
+
+
+def _prompt_checked_token(prompt) -> tuple[str, Optional[DiscordBotCheck]]:
+ """A token Discord accepted (with its check), an unverifiable one (offline: ``None`` check),
+ or ``("", None)`` when the user gave up."""
+ from hermes_cli.cli_output import print_error, print_success, print_warning
+ from tools.discord_tool import DiscordAPIError
+ for _attempt in range(3):
+ token = _prompt_discord_bot_token(prompt).strip()
+ if not token:
+ return "", None
+ try:
+ check = check_bot_token(token)
+ except DiscordAPIError as exc:
+ if exc.status == 401:
+ print_error("Discord rejected that token. On the Bot page click Reset Token, "
+ "copy the new token and paste it here.")
+ continue
+ print_warning(f"Couldn't verify the token (Discord answered {exc.status}); saving it anyway.")
+ return token, None
+ except OSError as exc:
+ print_warning(f"Couldn't reach Discord to verify the token ({exc}); saving it anyway.")
+ return token, None
+ print_success(f"Token works: this is the bot \"{check.bot_name}\"")
+ return token, check
+ print_error("Discord rejected three tokens in a row; nothing was saved.")
+ return "", None
+
+
+def _ensure_message_content_intent(token: str, check: DiscordBotCheck, prompt) -> DiscordBotCheck:
+ from hermes_cli.cli_output import print_info, print_success, print_warning
+ from tools.discord_tool import DiscordAPIError
+ for _attempt in range(5):
+ if check.message_content:
+ break
+ print_warning("Message Content Intent is OFF: the bot would receive every message with the text blank.")
+ print_info(f" Turn it on here: {check.bot_settings_url}")
+ print_info(" (Privileged Gateway Intents → Message Content Intent → Save Changes)")
+ if prompt("Press Enter once it's saved to re-check, or type 'skip'").strip().lower() == "skip":
+ return check
+ try:
+ check = check_bot_token(token)
+ except (DiscordAPIError, OSError):
+ return check
+ if check.message_content:
+ print_success("Message Content Intent is on")
+ if not check.server_members:
+ print_info("Optional: turn on Server Members Intent on the same page if you want to "
+ "allow people by username or role instead of user ID.")
+ return check
+
+
+def _print_invite(check: DiscordBotCheck) -> None:
+ from hermes_cli.cli_output import print_info
+ print()
+ if check.server_count == 0:
+ print_info("📨 The bot isn't in any server yet. Open this link to add it to yours:")
+ else:
+ print_info("📨 Invite link (adds the bot to a server with the permissions Hermes uses):")
+ print_info(f" {check.invite_url}")
+ print_info(" Once you share a server with the bot you can also DM it directly.")
+
+
+def _prompt_allowlist(check: Optional[DiscordBotCheck], prompt, prompt_yes_no) -> None:
+ from hermes_cli.cli_output import print_info, print_success
+ from hermes_cli.config import save_env_value
+ print()
+ print_info("🔒 Security: only allowlisted Discord users can talk to your bot.")
+ allowed: list = []
+ if check and check.owners:
+ who = ", ".join(f"@{name}" for _uid, name in check.owners)
+ question = (f"Allow yourself ({who}) to talk to the bot?" if len(check.owners) == 1
+ else f"Allow your team ({who}) to talk to the bot?")
+ if prompt_yes_no(question, True):
+ allowed = [uid for uid, _name in check.owners]
+ print_info(" Others need their Discord user ID: Settings → Advanced → Developer Mode,")
+ print_info(" then right-click their name → Copy User ID. Usernames work too.")
+ raw = prompt("Other allowed users (comma-separated, Enter to skip)" if allowed
+ else "Allowed user IDs or usernames (comma-separated, leave empty for open access)")
+ extra = _clean_discord_user_ids(raw or "")
+ allowed += [uid for uid in extra if uid not in allowed]
+ if check and not check.server_members and any(not uid.isdigit() for uid in extra):
+ print_info(" Usernames are resolved when the gateway connects, which needs Server Members Intent: "
+ f"{check.bot_settings_url}")
+ if allowed:
+ save_env_value("DISCORD_ALLOWED_USERS", ",".join(allowed))
+ print_success("Discord allowlist configured")
+ else:
+ print_info(
+ "⚠️ No allowlist set. Discord will deny messages until you set "
+ "DISCORD_ALLOWED_USERS, DISCORD_ALLOWED_ROLES, DISCORD_ALLOWED_CHANNELS, "
+ "or DISCORD_ALLOW_ALL_USERS=true for open access."
+ )
+
+
+def _check_saved_token(token: str) -> Optional[DiscordBotCheck]:
+ from tools.discord_tool import DiscordAPIError
+ try:
+ return check_bot_token(token) if token else None
+ except (DiscordAPIError, OSError):
+ return None
+
+
+def interactive_setup() -> None:
+ """Guide the user through Discord bot setup: token (checked live), intents, invite link,
+ allowlist (defaults to the bot's owner) and home channel. CLI imports are lazy."""
+ from hermes_cli.cli_output import print_header, print_info, print_success, prompt, prompt_yes_no
+ from hermes_cli.config import get_env_value, remove_env_value, save_env_value
+ from hermes_cli.setup_platforms import declines_reconfigure
+
+ print_header("Discord")
+ if declines_reconfigure("Discord", "Reconfigure Discord?", "DISCORD_BOT_TOKEN"):
+ if not get_env_value("DISCORD_ALLOWED_USERS"):
+ print_info(
+ "⚠️ Discord has no user allowlist. With the fail-closed default, "
+ "messages are denied unless you configure allowed users, roles, "
+ "or channels, or set DISCORD_ALLOW_ALL_USERS=true."
+ )
+ if prompt_yes_no("Add allowed users now?", True):
+ saved = _check_saved_token(get_env_value("DISCORD_BOT_TOKEN") or "")
+ _prompt_allowlist(saved, prompt, prompt_yes_no)
+ return
+ for line in (
+ "1. Open https://discord.com/developers/applications → New Application",
+ "2. Open the Bot page → Reset Token → copy the token",
+ "Hermes checks the token, the intents and the invite link for you next.",
+ "Guide: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/discord",
+ ):
+ print_info(line)
+ token, check = _prompt_checked_token(prompt)
+ if not token:
+ return
+ save_env_value("DISCORD_BOT_TOKEN", token)
+ print_success("Discord token saved")
+ if check is None:
+ print_info("Make sure Message Content Intent is on (Bot page → Privileged Gateway Intents), "
+ "or the bot will see blank messages.")
+ else:
+ check = _ensure_message_content_intent(token, check, prompt)
+ _print_invite(check)
+ _prompt_allowlist(check, prompt, prompt_yes_no)
+ print()
+ for line in (
+ "📬 Home Channel: where Hermes delivers cron job results,",
+ " cross-platform messages, and notifications.",
+ " Easiest: type /set-home in a Discord channel once the bot is running.",
+ " Or paste a channel ID (Developer Mode → right-click a channel → Copy Channel ID).",
+ ):
+ print_info(line)
+ home_channel = prompt("Home channel ID (leave empty to set later with /set-home)").strip()
+ if home_channel:
+ save_env_value("DISCORD_HOME_CHANNEL", home_channel)
+ elif remove_env_value("DISCORD_HOME_CHANNEL"):
+ print_info("Home channel cleared.")
diff --git a/tests/gateway/test_discord_plugin_setup.py b/tests/gateway/test_discord_plugin_setup.py
index 408be48252f..bc341003536 100644
--- a/tests/gateway/test_discord_plugin_setup.py
+++ b/tests/gateway/test_discord_plugin_setup.py
@@ -1,4 +1,4 @@
-"""Tests for the Discord plugin's interactive_setup wizard home-channel flow.
+"""Tests for the Discord plugin's interactive_setup wizard.
The interactive_setup wizard lazy-imports its CLI helpers from
``hermes_cli.config`` (get_env_value / save_env_value / remove_env_value) and
@@ -8,11 +8,21 @@ PR #58421 and extended in the follow-up.
"""
import hermes_cli.config as config_mod
import hermes_cli.cli_output as cli_output_mod
-from plugins.platforms.discord.adapter import interactive_setup
+import tools.discord_tool as discord_tool
+from plugins.platforms.discord import onboarding
+from plugins.platforms.discord.onboarding import interactive_setup
+from tests.fakes.platforms.discord_standin import APP_ID, TOKEN, DiscordStandin
+_real_check = onboarding.check_bot_token
-def _patch_setup_io(monkeypatch, prompts, saved, removed, existing, infos=None):
+
+def _offline(_token):
+ raise OSError("offline")
+
+
+def _patch_setup_io(monkeypatch, prompts, saved, removed, existing, infos=None, yes=False, check=_offline):
prompt_iter = iter(prompts)
+ monkeypatch.setattr(onboarding, "check_bot_token", check)
monkeypatch.setattr(config_mod, "get_env_value", lambda key: existing.get(key, ""))
monkeypatch.setattr(config_mod, "save_env_value", lambda k, v: saved.update({k: v}))
@@ -22,7 +32,7 @@ def _patch_setup_io(monkeypatch, prompts, saved, removed, existing, infos=None):
monkeypatch.setattr(config_mod, "remove_env_value", _remove)
monkeypatch.setattr(cli_output_mod, "prompt", lambda *_a, **_kw: next(prompt_iter))
- monkeypatch.setattr(cli_output_mod, "prompt_yes_no", lambda *_a, **_kw: False)
+ monkeypatch.setattr(cli_output_mod, "prompt_yes_no", lambda *_a, **_kw: yes)
for name in ("print_header", "print_success", "print_warning"):
monkeypatch.setattr(cli_output_mod, name, lambda *_a, **_kw: None)
@@ -57,8 +67,27 @@ class TestDiscordHomeChannelClear:
assert "DISCORD_HOME_CHANNEL" not in saved
+class TestDiscordTokenCheckedWithDiscord:
+ """The wizard asks Discord about the pasted token: a rejected token is never saved, and an
+ accepted one yields the invite link and an allowlist seeded with the bot's owner."""
-
+ def test_rejected_token_reprompts_and_owner_is_allowlisted(self, monkeypatch, tmp_path):
+ monkeypatch.setenv("HERMES_HOME", str(tmp_path))
+ standin = DiscordStandin().start()
+ try:
+ monkeypatch.setattr(discord_tool, "DISCORD_API_BASE", standin.api_base)
+ saved, removed, infos, errors = {}, [], [], []
+ _patch_setup_io(monkeypatch, ["not.the.token", TOKEN, "", ""], saved, removed,
+ existing={}, infos=infos, yes=True, check=_real_check)
+ monkeypatch.setattr(cli_output_mod, "print_error", lambda *a, **_kw: errors.append(" ".join(map(str, a))))
+ interactive_setup()
+ finally:
+ standin.stop()
+ assert saved["DISCORD_BOT_TOKEN"] == TOKEN
+ assert any("rejected" in e for e in errors)
+ assert saved["DISCORD_ALLOWED_USERS"] == "1" # the stand-in application's owner
+ invite = next(line.strip() for line in infos if "oauth2/authorize" in line)
+ assert f"client_id={APP_ID}" in invite and f"permissions={onboarding.INVITE_PERMISSIONS}" in invite
class TestDiscordTokenShapeGuard:
diff --git a/tests/plugins/platforms/test_interactive_setup_reconfigure_gate.py b/tests/plugins/platforms/test_interactive_setup_reconfigure_gate.py
index e9a4c3b26a2..bacac579ce1 100644
--- a/tests/plugins/platforms/test_interactive_setup_reconfigure_gate.py
+++ b/tests/plugins/platforms/test_interactive_setup_reconfigure_gate.py
@@ -19,7 +19,7 @@ import hermes_cli.setup_platforms as setup_platforms_mod
_WIZARDS = [
("plugins.platforms.buzz.adapter", "BUZZ_RELAY_URL"),
("plugins.platforms.dingtalk.adapter", "DINGTALK_CLIENT_ID"),
- ("plugins.platforms.discord.adapter", "DISCORD_BOT_TOKEN"),
+ ("plugins.platforms.discord.onboarding", "DISCORD_BOT_TOKEN"),
("plugins.platforms.feishu.adapter", "FEISHU_APP_ID"),
("plugins.platforms.google_chat.adapter", "GOOGLE_CHAT_SUBSCRIPTION_NAME"),
("plugins.platforms.irc.adapter", "IRC_SERVER"),
diff --git a/website/docs/user-guide/messaging/discord.md b/website/docs/user-guide/messaging/discord.md
index 0c9f4b3348f..c23e5db0036 100644
--- a/website/docs/user-guide/messaging/discord.md
+++ b/website/docs/user-guide/messaging/discord.md
@@ -105,6 +105,10 @@ Any knob at `0` disables the whole WebSocket liveness probe. Values that fail to
`websocket_event_max_silence_seconds` is the exception: it guards a single dimension (event dispatch), so `0` opts out of **that check only** — ready/ACK/latency keep guarding. A socket can stay ESTABLISHED and keep ACKing heartbeats while delivering zero Gateway events; heartbeat ACKs are frames without an event type, so no transport-side check can see that state. The default (4 hours) matches the outage window operators have observed in the field; a quiet guild can legitimately go hours without a single Gateway event, so keep this bound generous unless you know your traffic.
+:::tip[Shortcut: let the wizard do Steps 5–7]
+Create the application and copy the bot token (Steps 1–4), then run `hermes gateway setup` and pick **Discord**. Hermes checks the token with Discord, tells you if **Message Content Intent** is off (with a link straight to the toggle), prints a ready-made invite link for your server, and allowlists you as the bot's owner — no Developer Mode needed.
+:::
+
## Step 1: Create a Discord Application
1. Go to the [Discord Developer Portal](https://discord.com/developers/applications) and sign in with your Discord account.
@@ -219,6 +223,7 @@ These are the minimum permissions your bot needs:
|-------|-------------------|-----------------|
| Minimal | `117760` | View Channels, Send Messages, Read Message History, Attach Files |
| Recommended | `274878286912` | All of the above plus Embed Links, Send Messages in Threads, Add Reactions |
+| Full (what `hermes gateway setup` prints) | `309240908864` | Recommended plus Create Public Threads (for `auto_thread`) and Connect/Speak (voice channels) |
## Step 6: Invite to Your Server
@@ -258,7 +263,7 @@ Run the guided setup command:
hermes gateway setup
```
-Select **Discord** when prompted, then paste your bot token and user ID when asked.
+Select **Discord** when prompted and paste your bot token. The wizard verifies it with Discord (a wrong or stale token is rejected before it is saved), checks the privileged intents, prints the invite link, and offers to allowlist the bot's owner — you. Extra users can be added by user ID or username.
### Option B: Manual Configuration