Skip to content

Discord slash commands in threads fail with "This channel is not allowed." when using per-channel allowlist #1122

Description

@dougvk

Hi! I’m running Clawdbot in a Discord guild with channels.discord.groupPolicy = "allowlist" and a per-channel allowlist under channels.discord.guilds.<guildId>.channels.

Problem

Discord threads have their own channel ID. When I invoke a native slash command (e.g. /status, /new, etc.) inside a thread, Clawdbot evaluates the allowlist against the thread ID, not the parent channel ID, and replies:

"This channel is not allowed."

Even though the parent channel is allowlisted.

Expected

If a thread is created under an allowlisted parent channel, slash commands in the thread should work by inheriting the parent channel’s allowlist/config (unless the thread is explicitly configured/denied).

Actual

Slash commands in threads are denied unless the thread ID itself is added to the allowlist.

Config example

{
  "channels": {
    "discord": {
      "groupPolicy": "allowlist",
      "guilds": {
        "<guildId>": {
          "channels": {
            "<parentChannelId>": { "allow": true }
          }
        }
      }
    }
  }
}
  • Works in <parentChannelId>
  • Fails in <threadChannelId> created under <parentChannelId>

Workarounds

1) Allowlist each thread ID explicitly

Add every thread ID under channels.discord.guilds.<guildId>.channels.<threadId>.allow=true.

Works, but not practical — thread IDs change per thread.

2) Remove per-channel allowlist and allow by guild, restrict by user

Delete channels.discord.guilds.<guildId>.channels entirely (don’t leave {}), then restrict via:

{
  "channels": {
    "discord": {
      "groupPolicy": "allowlist",
      "guilds": {
        "<guildId>": {
          "users": ["<yourUserId>"],
          "requireMention": true
        }
      }
    }
  }
}

This avoids thread-ID allowlist checks, so threads work, but it’s a broader allow than intended.

Request

Could Clawdbot treat thread channel configs as inheriting from the parent channel config (or at least fall back to parentId for allowlist checks) for Discord native slash commands?

Also, documenting that "threads have separate channel IDs; per-channel allowlists must include thread IDs" would help avoid surprises if inheritance isn’t desired.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions