openclaw - 💡(How to fix) Fix Discord channel handler stuck at 'awaiting gateway readiness' — standalone discord.js works fine [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#61505Fetched 2026-04-08 02:57:51
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

The Discord channel plugin initializes and logs in successfully, but never progresses past "awaiting gateway readiness". No messages are received or processed. A standalone discord.js test with the same bot token connects and receives the ready event within seconds.

Error Message

[discord] [default] starting provider
[discord] channels resolved: guild:<id>→<id> (guild:<server-name>)
[discord] client initialized as <bot-id> (Friday); awaiting gateway readiness

No further Discord log entries appear — no ready, no errors, no timeouts.

Root Cause

The Discord channel plugin initializes and logs in successfully, but never progresses past "awaiting gateway readiness". No messages are received or processed. A standalone discord.js test with the same bot token connects and receives the ready event within seconds.

Code Example

[discord] [default] starting provider
[discord] channels resolved: guild:<id><id> (guild:<server-name>)
[discord] client initialized as <bot-id> (Friday); awaiting gateway readiness

---

const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ 
  intents: [
    GatewayIntentBits.Guilds, 
    GatewayIntentBits.GuildMessages, 
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.DirectMessages
  ] 
});
client.on('ready', () => { console.log('READY as ' + client.user.tag); process.exit(0); });
client.login('<BOT_TOKEN>');

---

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "<BOT_TOKEN>",
      "groupPolicy": "allowlist",
      "streaming": "partial",
      "dmPolicy": "pairing",
      "guilds": {
        "<GUILD_ID>": {
          "requireMention": true
        }
      }
    }
  }
}

---

openclaw 2026.4.4 (0ef2932)
discord.js 14.26.2
Node v25.8.2
macOS Darwin 25.4.0 arm64
RAW_BUFFERClick to expand / collapse

Version: OpenClaw 2026.4.4 (0ef2932) OS: macOS (Darwin 25.4.0, arm64) Node: v25.8.2

Summary

The Discord channel plugin initializes and logs in successfully, but never progresses past "awaiting gateway readiness". No messages are received or processed. A standalone discord.js test with the same bot token connects and receives the ready event within seconds.

Steps to Reproduce

  1. Configure Discord in openclaw.json with a valid bot token, dmPolicy: "pairing", groupPolicy: "allowlist", and a guild allowlist entry
  2. Start the gateway
  3. Observe logs: client initializes but never becomes ready
  4. Messages sent in the Discord server (including @mentions) are not received

Log Output

[discord] [default] starting provider
[discord] channels resolved: guild:<id>→<id> (guild:<server-name>)
[discord] client initialized as <bot-id> (Friday); awaiting gateway readiness

No further Discord log entries appear — no ready, no errors, no timeouts.

Standalone discord.js Test (WORKS)

Using the same bot token and the same node_modules/discord.js installation:

const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ 
  intents: [
    GatewayIntentBits.Guilds, 
    GatewayIntentBits.GuildMessages, 
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.DirectMessages
  ] 
});
client.on('ready', () => { console.log('READY as ' + client.user.tag); process.exit(0); });
client.login('<BOT_TOKEN>');

Output: READY as Friday#2731 — connects successfully within seconds.

Configuration

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "<BOT_TOKEN>",
      "groupPolicy": "allowlist",
      "streaming": "partial",
      "dmPolicy": "pairing",
      "guilds": {
        "<GUILD_ID>": {
          "requireMention": true
        }
      }
    }
  }
}

Bot Setup

  • Bot has all three Privileged Gateway Intents enabled (Presence, Server Members, Message Content)
  • Bot is authorized with bot + applications.commands scopes
  • Bot is visible as online on the server
  • Discord API confirms bot is on the guild (/users/@me/guilds returns the server)
  • DMs from server members are enabled in server privacy settings

Additional Packages Installed

discord.js, @discordjs/rest, @discordjs/ws, @buape/carbon, discord-api-types were all manually installed as they were missing from npm ci (related: #61363).

Expected Behavior

The Discord channel handler should receive the ready event from discord.js and begin processing messages.

Environment

openclaw 2026.4.4 (0ef2932)
discord.js 14.26.2
Node v25.8.2
macOS Darwin 25.4.0 arm64

extent analysis

TL;DR

The Discord channel handler in OpenClaw may not be properly configured to handle gateway intents, which is causing it to not receive the ready event and process messages.

Guidance

  • Verify that the GatewayIntentBits are correctly configured in the OpenClaw Discord channel handler to match the intents enabled for the bot in the Discord Developer Portal.
  • Check the OpenClaw configuration to ensure that the discord.js client is being initialized with the correct intents, similar to the standalone test.
  • Compare the standalone discord.js test code with the OpenClaw Discord channel handler code to identify any differences in intent configuration or client initialization.
  • Ensure that the discord.js version used in the OpenClaw project is compatible with the version used in the standalone test.

Example

// Example of how to configure GatewayIntentBits in OpenClaw
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ 
  intents: [
    GatewayIntentBits.Guilds, 
    GatewayIntentBits.GuildMessages, 
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.DirectMessages
  ] 
});

Notes

The issue may be related to the configuration of gateway intents in OpenClaw, which is not explicitly shown in the provided code. The standalone test code provides a working example of how to configure intents, which can be used as a reference to update the OpenClaw configuration.

Recommendation

Apply workaround: Update the OpenClaw Discord channel handler to correctly configure gateway intents, as shown in the standalone test code, to ensure that the ready event is received and messages are processed.

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