openclaw - 💡(How to fix) Fix [Feature] Discord Slash Commands: Per-channel command visibility for multi-bot setups [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69629Fetched 2026-04-22 07:49:57
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Fix Action

Fix / Workaround

Option C: Guild-level isolation (Workaround)

Document the current workaround more clearly:

  • Deploy different bots to different Discord servers for complete isolation

  • This is not ideal for users who want a unified server experience

  • OpenClaw Version: 2026.4.x

  • Discord Gateway Intents: Message Content, Server Members enabled

  • Related Issues: This appears to be a Discord platform limitation, but other bot frameworks (e.g., discord.py, discord.js) have found workarounds using command scoping

Code Example

{
  "channels": {
    "discord": {
      "accounts": {
        "main": {
          "guilds": {
            "GUILD_ID": {
              "channels": { "CHANNEL_A": {} }
            }
          }
        },
        "coding": {
          "guilds": {
            "GUILD_ID": {
              "channels": { "CHANNEL_B": {} }
            }
          }
        },
        "work": {
          "guilds": {
            "GUILD_ID": {
              "channels": { "CHANNEL_C": {} }
            }
          }
        }
      }
    }
  },
  "bindings": [
    {"agentId": "main", "match": {"channel": "discord", "accountId": "main", "guildId": "GUILD_ID", "channels": ["CHANNEL_A"]}},
    {"agentId": "coding", "match": {"channel": "discord", "accountId": "coding", "guildId": "GUILD_ID", "channels": ["CHANNEL_B"]}},
    {"agentId": "work", "match": {"channel": "discord", "accountId": "work", "guildId": "GUILD_ID", "channels": ["CHANNEL_C"]}}
  ]
}
RAW_BUFFERClick to expand / collapse

Is your feature request related to a problem? Please describe.

When running multiple OpenClaw bots (each with different accountId) in the same Discord guild but configured to respond to different channels, the Discord slash command menu (/) shows all bots' commands in all channels, regardless of which bot is assigned to which channel.

This creates several issues:

  1. User confusion: Users see commands from bots that shouldn't be available in the current channel
  2. Accidental command execution: Users may accidentally select the wrong bot's command from the dropdown
  3. Bot automation errors: When bots execute automated workflows with slash commands, they may inadvertently send commands to the wrong bot
  4. Visual clutter: The command palette becomes cluttered with irrelevant commands

Current Configuration Example

{
  "channels": {
    "discord": {
      "accounts": {
        "main": {
          "guilds": {
            "GUILD_ID": {
              "channels": { "CHANNEL_A": {} }
            }
          }
        },
        "coding": {
          "guilds": {
            "GUILD_ID": {
              "channels": { "CHANNEL_B": {} }
            }
          }
        },
        "work": {
          "guilds": {
            "GUILD_ID": {
              "channels": { "CHANNEL_C": {} }
            }
          }
        }
      }
    }
  },
  "bindings": [
    {"agentId": "main", "match": {"channel": "discord", "accountId": "main", "guildId": "GUILD_ID", "channels": ["CHANNEL_A"]}},
    {"agentId": "coding", "match": {"channel": "discord", "accountId": "coding", "guildId": "GUILD_ID", "channels": ["CHANNEL_B"]}},
    {"agentId": "work", "match": {"channel": "discord", "accountId": "work", "guildId": "GUILD_ID", "channels": ["CHANNEL_C"]}}
  ]
}

Describe the solution you'd like

Option A: Discord-native command scoping (Preferred)

Respect Discord's per-channel command permissions by:

  • Registering slash commands only in allowed channels per bot account
  • Using Discord's Command Scoping to hide commands from unauthorized channels
  • This would make commands from "main" bot invisible in "coding" channels, etc.

Option B: OpenClaw-level command filtering

If Discord doesn't support channel-level command scoping:

  • Add a configuration option to disable global command registration
  • Allow bots to respond only to text-based commands (e.g., !cmd or @bot cmd) in channels where they're authorized
  • Provide a way to suppress command palette visibility for bots in unauthorized channels

Option C: Guild-level isolation (Workaround)

Document the current workaround more clearly:

  • Deploy different bots to different Discord servers for complete isolation
  • This is not ideal for users who want a unified server experience

Describe alternatives you've considered

  1. Using requireMention: true: This doesn't solve the command palette visibility issue, and makes interaction more cumbersome
  2. Separate Discord servers: Works but fragments the user experience
  3. Accepting the current behavior: Safe due to OpenClaw's routing protections, but confusing for users

Additional context

  • OpenClaw Version: 2026.4.x
  • Discord Gateway Intents: Message Content, Server Members enabled
  • Related Issues: This appears to be a Discord platform limitation, but other bot frameworks (e.g., discord.py, discord.js) have found workarounds using command scoping

Security Note

Currently, OpenClaw's bindings configuration does prevent unauthorized execution at the message routing level. However, the visual exposure of commands in the Discord UI remains a UX issue that could lead to user confusion and accidental command invocation.

Expected Behavior

When a user types / in CHANNEL_A:

  • ✅ Only commands from the bot assigned to CHANNEL_A should appear
  • ✅ Commands from bots assigned to CHANNEL_B and CHANNEL_C should be hidden
  • ✅ This should work without requiring requireMention: true

Impact

This feature would significantly improve:

  • Multi-agent deployments where different agents serve different purposes
  • Enterprise/Team setups with role-based bot access
  • User experience by reducing command palette clutter
  • Automation reliability by preventing accidental cross-bot command execution

extent analysis

TL;DR

Implement Discord-native command scoping by registering slash commands only in allowed channels per bot account and using Discord's Command Scoping to hide commands from unauthorized channels.

Guidance

  • Review the Discord API documentation to understand how to register slash commands per channel and implement Command Scoping.
  • Update the OpenClaw configuration to include channel-specific command registration and scoping.
  • Test the implementation to ensure that commands from one bot are not visible in channels assigned to other bots.
  • Consider implementing a fallback solution, such as OpenClaw-level command filtering, if Discord-native command scoping is not feasible.

Example

No code example is provided as the solution requires integration with the Discord API and OpenClaw configuration updates.

Notes

The solution may require updates to the OpenClaw framework to support Discord-native command scoping. Additionally, the implementation may need to consider edge cases, such as handling commands that are registered globally but should be hidden in certain channels.

Recommendation

Apply workaround by implementing Discord-native command scoping, as it is the preferred solution and aligns with Discord's API capabilities. This approach will provide a more seamless user experience and reduce command palette clutter.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature] Discord Slash Commands: Per-channel command visibility for multi-bot setups [1 participants]