From e371af1df2778ce3efedc97ac25e1fe9e030d342 Mon Sep 17 00:00:00 2001 From: fuleinist Date: Tue, 21 Apr 2026 02:06:52 +0800 Subject: [PATCH] Add config option to disable Discord slash commands 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 #4881 --- gateway/platforms/discord.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gateway/platforms/discord.py b/gateway/platforms/discord.py index 9857b8ffd9..a148c5f4b9 100644 --- a/gateway/platforms/discord.py +++ b/gateway/platforms/discord.py @@ -527,6 +527,7 @@ class DiscordAdapter(BasePlatformAdapter): # Reply threading mode: "off" (no replies), "first" (reply on first # chunk only, default), "all" (reply-reference on every chunk). self._reply_to_mode: str = getattr(config, 'reply_to_mode', 'first') or 'first' + self._slash_commands: bool = self.config.extra.get("slash_commands", True) async def connect(self) -> bool: """Connect to Discord and start receiving events.""" @@ -744,7 +745,8 @@ class DiscordAdapter(BasePlatformAdapter): ) # Register slash commands - self._register_slash_commands() + if self._slash_commands: + self._register_slash_commands() # Start the bot in background self._bot_task = asyncio.create_task(self._client.start(self.config.token))