#Making Bot un discord channel better

1 messages · Page 1 of 1 (latest)

shut marlinBOT
#

The Dashboard isn’t a “more powerful bot” — it’s just a UI talking to your Gateway as an operator/admin. To get the same ability from a Discord channel, you need to line up three things:

  1. Discord-side permissions (can the bot actually do the action in that channel?)
  2. OpenClaw Discord allowlists (is this channel/user allowed to talk to the agent?)
  3. Owner-only + action gates (are you treated as “owner”, and are the Discord action groups enabled?)

1) Lock it to that one channel + your user

Use Discord allowlisting at the guild + channel level, and only allow your Discord user ID in that channel.

Example (JSON5):

{
  channels: {
    discord: {
      groupPolicy: "allowlist",
#
      guilds: {
        "YOUR_GUILD_ID": {
          requireMention: false,          // respond without @mention (optional)
          users: ["YOUR_USER_ID"],        // only you can drive it
          channels: {
            "YOUR_CHANNEL_ID": {
              allow: true,
              requireMention: false,
              users: ["YOUR_USER_ID"],
            },
          },
        },
      },
    },
  },
#
}

Docs: https://docs.openclaw.ai/channels/discord (see Access control and routing)

2) Make sure you’re “owner” (so owner-only tools work)

Some tools are owner-only (notably cron and gateway). To make Discord feel like the Dashboard, make sure your Discord sender is considered an owner.

The most common/simple approach for Discord is: include your user ID in:

  • channels.discord.allowFrom (and keep DM policy restrictive if you want), or
  • commands.ownerAllowFrom (global “owner list” across channels)

Related behavior is documented in:

#

3) Enable the “do anything” knobs (carefully)

Discord action groups are gated. By default, moderation/roles/presence are disabled even if the bot has Discord permissions.

If you want the bot to be able to do admin-y Discord things, enable the relevant gates:

  • channels.discord.actions.moderation
  • channels.discord.actions.roles
  • channels.discord.actions.presence

(Only turn on what you actually need.)

Bonus: If you mean “change config from Discord”

You’ll want /config … commands:

  • set commands.config: true
  • ensure channels.discord.configWrites isn’t disabled
#

Docs: https://docs.openclaw.ai/tools/slash-commands


If you paste your current channels.discord block (redact the bot token), and tell me:

  • the guild ID
  • the channel ID
  • your user ID
    …I can point out exactly what to change so only that channel gets “dashboard-level” control without opening the rest of the server.
barren schooner
#

by guild id, do you mean the sever ID?

shut marlinBOT
#

Yes — in Discord terminology, a Guild = a Server.

So:

  • guildId = Server ID
  • channelId = the specific text channel’s ID
  • userId = your Discord user ID

How to grab them (Discord app):

  1. Enable Developer Mode
    Settings → Advanced → Developer Mode (on)

  2. Copy IDs

    • Right‑click the server icon → Copy Server ID (this is the guildId)
    • Right‑click the channel → Copy Channel ID
    • Right‑click your user (or your avatar) → Copy User ID
#

Perfect — with those IDs you can lock things down so only you can drive the bot in that one channel, and you’ll be treated as an owner (so owner-only stuff like /config, cron, gateway works).

Here’s a solid baseline config (edit into your openclaw.json under the existing channels.discord / commands blocks):

{
  commands: {
    config: true, // enables /config show|get|set|unset (owner-only)
    debug: true,  // optional: enables /debug (owner-only)
  },

  channels: {
    discord: {
      groupPolicy: "allowlist",

      // Marks who is "owner" on Discord (also used for DM allowlist behavior)
#
      allowFrom: ["288875703670276097"],

      guilds: {
        "1478964061583708215": {
          requireMention: false,          // respond without @mention in this server (optional)
          users: ["288875703670276097"],  // only you can talk to it in this guild

          // If you define `channels`, everything not listed is denied.
          channels: {
            "1478964062422306880": {
              allow: true,
              requireMention: false,
              users: ["288875703670276097"], // only you in this channel
            },
          },
#
        },
      },

      // OPTIONAL: only if you want Discord admin/mod features via tools.
      // By default, moderation/roles/presence are disabled.
      // actions: { moderation: true, roles: true, presence: true },
    },
  },
}

Then restart the gateway.

To verify it’s behaving how you want:

  • In 1478964062422306880, send a normal message (no mention) → it should respond.
  • From any other channel in that server → it should ignore you (because it’s not allowlisted).
#
  • Try /config show in the allowlisted channel (should work if you’re treated as owner).

Docs refs:

If you tell me whether you want it to require @mention in that channel or be always-on, I can tweak the requireMention placement (guild-level vs channel-level) to match your preference.

barren schooner
#

no, this isnt what I want. I want the other 3 channels I have to continue to work as they are, where I am able to chat directly with the bots in those channels. I only want to change it so the channel I just gave you has full owner, admin, etc functions.

#

and no @mention. I just want it to respond

shut marlinBOT
#

Got it — you want the other 3 channels unchanged, and only this one channel (1478964062422306880) to be treated as the “owner/admin control room”.

Key detail: don’t set channels.discord.allowFrom or commands.ownerAllowFrom for this, because those make you “owner” everywhere on Discord.

What to do instead: make owner be per-channel

OpenClaw can derive owner status per Discord channel from the channel’s users allowlist.

Add (or edit) just this one channel entry:

{
  channels: {
    discord: {
      guilds: {
        "1478964061583708215": {
          channels: {
#
            "1478964062422306880": {
              allow: true,
              users: ["288875703670276097"] // <- this makes you "owner" in THIS channel
            }
          }
        }
      }
    }
  }
}

That will make owner-only features (like /config …, gateway, cron, etc.) work in that channel, but not in the other channels.

Important: don’t accidentally break your other channels

  • If you already have a channels: { ... } map listing your other 3 channels, just add this one more entry.
#
  • If you do not currently have a channels map (meaning you allow the whole guild), and you add one, you must keep other channels allowed too. Easiest is a wildcard allow:
channels: {
  "*": { allow: true }, // keep the other channels working as they are
  "1478964062422306880": { allow: true, users: ["288875703670276097"] }
}

After changing config

Restart the gateway, then test:

  • In 1478964062422306880: try /config show → should work (if commands.config=true)
  • In the other channels: /config show → should be blocked (not owner there)

If you paste your current channels.discord.guilds["1478964061583708215"] block (redact tokens), I’ll tell you exactly where to splice this so you don’t disturb the existing 3 channels.

#

To make that specific channel respond without @mention, set requireMention: false on the channel entry.

Example (merge into your existing guild config):

{
  channels: {
    discord: {
      guilds: {
        "1478964061583708215": {
          channels: {
            // keep your other channels working however they already do
            // (only include this "*" line if you currently allow the whole guild
            // and you’re introducing a channels map for the first time)
            "*": { allow: true },
#
            // your “admin” channel
            "1478964062422306880": {
              allow: true,
              requireMention: false, // <- no @mention needed
              users: ["288875703670276097"] // <- owner/admin capabilities only here (optional but typical)
            }
          }
        }
      }
    }
  }
}

Then restart the gateway.

#

One quick clarification (so I don’t steer you wrong): in that admin channel, do you want it to respond to everyone without mention, or only you without mention?

  • If only you: keep users: ["288875703670276097"].
  • If everyone: we should not use users as-is (it becomes an access restriction), and we’ll handle “owner-only” via a different pattern.
barren schooner
#

i am the only person who will ever have access or even be in the server

shut marlinBOT
#

If you’re literally the only human who will ever be in that Discord server, you’ve got two clean options — depends whether you want “admin everywhere” or “admin only in one channel”.

Option A (simplest): make every channel behave like the dashboard

Set the guild to not require mentions, and make yourself the guild user allowlist (this will effectively make you “owner” everywhere in that guild):

channels: {
  discord: {
    groupPolicy: "allowlist",
    guilds: {
      "1478964061583708215": {
        requireMention: false,
        users: ["288875703670276097"],
      }
    }
  }
#
}

That means you can run owner-only stuff from any channel.

Option B (what you asked for): only ONE channel has owner/admin powers

Keep other channels working normally, but only your “admin channel” gets owner status + no-mention replies.

channels: {
  discord: {
    groupPolicy: "allowlist",
    guilds: {
      "1478964061583708215": {
        // leave this alone if you want other channels to keep their current mention behavior
#
        // requireMention: true|false (whatever you currently use)

        channels: {
          "*": { allow: true }, // keeps other channels working without listing them

          "1478964062422306880": {
            allow: true,
            requireMention: false,          // respond without @mention in THIS channel
            users: ["288875703670276097"],  // owner/admin capabilities only in THIS channel
          }
        }
      }
    }
  }
}
#

With Option B:

  • the bot will respond without @mention in 1478964062422306880
  • /config … (and other owner-only actions) should work only there
  • other channels keep whatever behavior you already had

After you edit config: restart the gateway.

If you paste your current channels.discord.guilds["1478964061583708215"] section, I can tell you exactly which lines to add so you don’t accidentally override your existing 3 channels’ settings.

barren schooner
#

Lets go with option A, so all of the channels have admin. I am going to post the redacted "channels" [portion of my .json right after this message. Please merge in the changes for option A so I can just copy/paste it back to my .json.

shut marlinBOT
#

Yep — paste your redacted channels section (ideally the whole channels: { ... } block, or at least channels.discord), and I’ll return a single copy/paste-ready replacement with Option A merged in.

A couple notes so the merge is correct:

  • Please keep the structure/indentation exactly as-is when you paste (JSON5 comments/trailing commas are fine).
  • Redact secrets like token / DISCORD_BOT_TOKEN, but do not redact your groupPolicy, guilds, requireMention, channels, etc.
  • Option A needs these added/updated under your guild entry:
    • requireMention: false
    • users: ["288875703670276097"]

Send the snippet and I’ll merge it cleanly.

#

Your snippet already is Option A — you’ve got:

  • requireMention: false at the guild level (so no @mention needed)
  • users: ["288875703670276097"] at the guild level (so you’re treated as “owner” across all channels in that guild)

So there’s nothing else to merge for Option A.

Copy/paste-ready channels block (token placeholder)

Do not paste your token in public again. Put the real token back locally (or better: via env var / secrets).

"channels": {
  "discord": {
    "capabilities": ["exec"],
    "enabled": true,
    "token": "YOUR_DISCORD_BOT_TOKEN",
#
    "groupPolicy": "allowlist",
    "streaming": "off",
    "guilds": {
      "1478964061583708215": {
        "requireMention": false,
        "users": ["288875703670276097"]
      }
    }
  }
},

Important security note: rotate your Discord bot token

You posted your bot token (even partially redacted, it’s not safe to assume it’s unusable). Treat it as compromised:

  1. Discord Developer Portal → your app → Bot → Reset Token
#
  1. Update channels.discord.token in your config
  2. Restart the gateway

If you want /config commands too (dashboard-like config editing from Discord), make sure you also have commands.config: true in your config (that’s outside the channels block you posted).

snow pathBOT