#discord commands are not working for my bot

1 messages · Page 1 of 1 (latest)

barren lintel
#

discord commands like /new are not working for me. can you please help me troubleshoot?

frozen ibexBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

old sinewBOT
#

Yep — let’s narrow down whether this is Discord native slash registration or OpenClaw’s text command parser.

First, can you paste:

openclaw --version
openclaw status --all

For /new specifically, try these checks:

  1. Send /new as a standalone message — no extra text before it. Most OpenClaw commands are parsed only when the message starts with /.
  2. If you mean Discord’s popup/native slash command menu: make sure your bot invite included both OAuth scopes:
    • bot
    • applications.commands
  3. In Discord Developer Portal → Bot, make sure Message Content Intent is enabled. Without this, text commands like /new may not be visible to the bot.
  4. Make sure the bot has channel perms: View Channel, Send Messages, Read Message History; for threads, also Send Messages in Threads.
barren lintel
#

i am not sure if the invite included oauth at all. how can i confirm and can we walk through fixing this please

old sinewBOT
#

Yep, we can walk it through.

Important distinction: if the invite was missing applications.commands, Discord’s native slash menu (/new appearing in the Discord command UI) won’t register. OpenClaw text commands may still work if Message Content Intent + permissions are right.

How to confirm:

  1. In Discord, go to the server where your bot is installed.
  2. Type / in a channel where the bot can see messages.
  3. Look for your bot/app in the command list.
    • If OpenClaw commands like /new, /status, etc. do not show under your bot, the invite probably missed applications.commands, or commands haven’t registered yet.

To fix the invite:

  1. Open Discord Developer Portal: https://discord.com/developers/applications
  2. Select your bot application.
  3. Go to OAuth2 → URL Generator.
  4. Under Scopes, select:
#
  • bot
    • applications.commands
  1. Under Bot Permissions, select at least:
    • View Channels
    • Send Messages
    • Read Message History
    • Embed Links
    • Attach Files
    • Add Reactions optional
    • Send Messages in Threads if using threads/forums
  2. Copy the generated URL and open it in your browser.
  3. Select the same server and authorize it again. You usually do not need to kick/remove the bot first.

Then on the OpenClaw side:

#
openclaw gateway restart

After restart, wait a minute or two, then try:

/new
/status

Also check Discord Developer Portal → Bot and make sure Message Content Intent is enabled. That matters for text commands.

If it still doesn’t work after that, paste:

#
openclaw --version
openclaw status --all

and any relevant openclaw logs --follow lines from when you send /new. Redact tokens/secrets.

barren lintel
#

Pickles
APP
— 4:17 PM
⚠️ Command produced no visible reply.

old sinewBOT
#

That warning is actually useful: Pickles did receive the native Discord slash command. So the invite probably does include applications.commands now, or at least Discord has a registered command for the app.

Now we’re debugging why OpenClaw handled the command but didn’t send a normal visible reply.

Please try these in order:

  1. Send /status from Discord’s slash menu.
  2. Send /new as plain text, not selected from the menu if Discord allows it. Easiest test: type /new, then press Esc to close the command picker, then send the message.
  3. Watch logs while doing that:
openclaw logs --follow

If you see anything about command authorization, group policy, visible replies, or delivery failure, paste that part.

Also paste:

#
openclaw --version
openclaw status --all

My current read: this is no longer an OAuth/invite-scope problem; it’s likely one of:

  • command authorization / allowlist mismatch for your Discord user
  • Discord channel/thread delivery permissions
  • native-command dispatch path producing no reply
  • group-channel visible reply config, especially if final replies are private unless sent through the message tool

Docs for the exact command behavior: https://docs.openclaw.ai/tools/slash-commands

barren lintel
#

/status returned this Pickles
APP
— 4:18 PM
You are not authorized to use this command.

old sinewBOT
#

Aha — good, we found the real issue. The command is reaching Pickles, but your Discord sender is not authorized for OpenClaw commands.

Your Discord user id from this thread is:

672314296671141893

Fix options:

Option A — authorize commands directly
Add your Discord user to commands.allowFrom:

{
  commands: {
#
    allowFrom: {
      discord: ["user:672314296671141893"]
    }
  }
}

If you already have commands.allowFrom, add that entry instead of replacing the whole block.

Option B — authorize via the Discord guild config
If this bot is for a Discord server workspace, make sure your guild config includes you under users:

{
  channels: {
#
    discord: {
      groupPolicy: "allowlist",
      guilds: {
        "YOUR_SERVER_ID": {
          requireMention: true,
          users: ["672314296671141893"]
        }
      }
    }
  }
}

Then restart the gateway:

#
openclaw gateway restart

After that, try /status again. If it works, /new should work too.

One important nuance: if commands.allowFrom is set, it becomes the command authorization source; channel allowlists/pairing won’t be used for commands. So if you already have commands.allowFrom, that’s the first place I’d check.

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

barren lintel
#

"commands": {}
allowFrom: {
discord: ["user:672314296671141893"]
},
"ownerAllowFrom": [
"telegram:1680296748"
]
},

fix this block for me please @pickle

old sinewBOT
#

Yep — that block is malformed because allowFrom and ownerAllowFrom need to be inside commands.

Use this shape:

{
  commands: {
    allowFrom: {
      discord: ["user:672314296671141893"]
    },
    ownerAllowFrom: [
      "telegram:1680296748"
    ]
  }
}
#

If your config file is strict JSON instead of JSON5, quote the keys and remove trailing commas:

{
  "commands": {
    "allowFrom": {
      "discord": ["user:672314296671141893"]
    },
    "ownerAllowFrom": [
      "telegram:1680296748"
    ]
  }
}

Then restart: