Skip to content

Instantly share code, notes, and snippets.

@HoraceShmorace
Last active April 12, 2026 17:43
Show Gist options
  • Select an option

  • Save HoraceShmorace/278c147eb92b9adea571ea8727a3bdd8 to your computer and use it in GitHub Desktop.

Select an option

Save HoraceShmorace/278c147eb92b9adea571ea8727a3bdd8 to your computer and use it in GitHub Desktop.
OpenClaw × Discord (Mac)

OpenClaw × Discord Setup (Mac)

1. Discord Developer Portal

  1. Go to discord.com/developers/applicationsNew Application
  2. Installation page → set Install Link to None
  3. Bot page:
    • Enable Message Content Intent (required)
    • Enable Server Members Intent (recommended)
    • Presence Intent optional
    • Toggle Public Bot off
    • Toggle Requires OAuth2 Code Grant off
    • Click Reset Token, copy the token
  4. OAuth2 → URL Generator:
    • Scopes: bot, applications.commands
    • Permissions: View Channels, Send Messages, Read Message History, Embed Links, Attach Files
    • Open the generated URL in browser to invite bot to your server

2. Verify Token

curl -H "Authorization: Bot YOUR_TOKEN" https://discord.com/api/v10/users/@me

Should return your bot's JSON. If 401, reset the token and try again.

3. Configure OpenClaw

openclaw config set channels.discord.token "YOUR_TOKEN"
openclaw config set channels.discord.enabled true --json
openclaw gateway restart

4. Fix Auth / Device Pairing

If logs show pairing required:

openclaw devices list        # find pending device
openclaw devices approve <REQUEST_ID>
openclaw gateway restart

5. Fix Claude CLI Auth

If openclaw doctor shows Claude CLI auth unavailable:

claude auth login
openclaw models auth login --provider anthropic --method cli --set-default
openclaw gateway restart

6. Discord Privacy Setting

Right-click your server icon → Privacy Settings → enable Direct Messages

7. Using the Bot

  • In server channels, @mention the bot to trigger a response
  • To remove mention requirement for your server:
    openclaw config set channels.discord.guilds.YOUR_SERVER_ID.requireMention false --json
    (Enable Developer Mode in Discord settings, then right-click server → Copy Server ID)

Troubleshooting

Symptom Fix
Bot offline (gray dot) Token wrong or not set — verify with curl
Failed to resolve Discord application id Token invalid — reset in Developer Portal
pairing required in logs Run openclaw devices list and approve pending device
Bot online but silent Add @mention or disable requireMention
pairing required for CLI Approve device scope upgrade via openclaw devices approve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment