Skip to content

feat: Add config option to disable Discord slash commands#13130

Closed
fuleinist wants to merge 1 commit into
NousResearch:mainfrom
fuleinist:fix/disable-slash-commands
Closed

feat: Add config option to disable Discord slash commands#13130
fuleinist wants to merge 1 commit into
NousResearch:mainfrom
fuleinist:fix/disable-slash-commands

Conversation

@fuleinist

Copy link
Copy Markdown
Contributor

Summary

Adds a new discord.slash_commands config option (default: true) to disable Discord slash command registration when running Hermes alongside other bots that use the same command names.

Problem

When running Hermes alongside other Discord bots on the same server, Hermes's registered slash commands (e.g. /stop, /reset, /status) override identical slash commands used by other bots. Discord's slash command autocomplete intercepts input before other bots can parse it as a text message.

Text-based parsing of /command continues to work perfectly without slash commands registered.

Solution

Add discord.slash_commands: false to config.yaml:

discord:
  slash_commands: false

When false, _register_slash_commands() is skipped. The text-based /command parsing continues to work normally.

Changes

  • gateway/platforms/discord.py: Added self._slash_commands initialization from config.extra.get("slash_commands", True)
  • Modified connect() to conditionally call _register_slash_commands() only when _slash_commands is True

Fixes #4881

Add discord.slash_commands config option (default: true) to allow
users to disable Discord slash command registration when running
alongside other bots that use the same command names.

When set to false in config.yaml:
  discord:
    slash_commands: false

The _register_slash_commands() call is skipped while text-based
parsing of /commands continues to work normally.

Fixes NousResearch#4881
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery platform/discord Discord bot adapter area/config Config system, migrations, profiles labels Apr 22, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks @fuleinist! Your feature flag was cherry-picked and merged via #14315 with your authorship preserved. One follow-up tweak applied — the or True on the config.extra.get(...) call would have silently defeated the flag (always True regardless of config), so we dropped it to just return the config value directly. Behavior now matches your intent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/discord Discord bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Config option to disable Discord slash commands

3 participants