Back to Article List

How to connect OpenClaw to Discord: Integration guide

How to connect OpenClaw to Discord: Integration guide

Discord is the first place OpenClaw stops feeling like a “personal assistant” and starts feeling like a shared tool for a team. You can keep it in one channel for quick Q&A or let it help with ops, releases or support. The catch is simple: Discord is noisy. If you connect OpenClaw and let it respond everywhere you’ll hate it fast.

This guide shows the clean setup path plus the safety defaults that prevent the usual mistakes: leaked tokens, missing intents and bots replying in #general at 3AM.

If you want the broader picture first see OpenClaw multi-channel setup. If you’re hosting on a VPS and you care about hardening (you should) read How to host OpenClaw securely on a VPS.

What you’re building in Discord

You don’t need to “code a Discord bot”. You create a Discord application, turn on a couple of intents, invite it to your server and give OpenClaw the bot token. After that OpenClaw connects through Discord’s official Bot API and your allowlists decide where it can talk.

The goal is not “bot everywhere”. The goal is “bot in the right places”. Most teams start with one channel and require a mention. Then expand slowly.

Before you start

  • You need admin access to the Discord server you’ll invite the bot into.
  • You need access to the Discord Developer Portal.
  • Keep the bot token private. If it leaks, reset it immediately.

Official portal: Discord Developer Portal

Create the Discord bot and copy the token

In the Developer Portal:

  1. Click New Application then name it something like “OpenClaw”.
  2. Open the Bot section in the left menu.
  3. Click Add Bot and confirm.
  4. Under Token click Reset Token (or Copy if it already exists) then store it somewhere safe.

Treat the token like an SSH key. Anyone with it can impersonate your bot. Discord’s own documentation explains how privileged access and gateway intents work.

Enable the intents OpenClaw needs

Still in Bot settings scroll to Privileged Gateway Intents and enable:

  • Message Content Intent (needed if OpenClaw should read normal message text)
  • Server Members Intent (helpful for allowlists and member lookups)

Quick nuance: if you keep “require mention” on in busy channels you can often reduce how much message content the bot needs to see. Discord documents what bots can access without Message Content enabled and what tradeoffs that implies.

Invite the bot to your server

In the Developer Portal go to OAuth2 then URL Generator:

  • Scopes: select bot. Select applications.commands only if you plan to use slash commands.
  • Bot permissions (start minimal):
    • View Channels
    • Send Messages
    • Read Message History
    • Embed Links (optional)
    • Attach Files (optional)

Avoid granting Administrator unless you’re debugging and you fully trust the integration. Invite links are a normal OAuth2 flow in Discord so it’s easy to revoke later if needed.

Copy the generated invite URL then open it in your browser, select your Discord server and authorize.

Turn on Developer Mode and copy IDs

To build safe allowlists you’ll want IDs for your server (guild) and the channel(s) you want OpenClaw to listen to.

  1. In Discord open User Settings then Advanced.
  2. Enable Developer Mode.
  3. Right-click your server name then choose Copy Server ID.
  4. Right-click the channel you want (for example #bot or #help) then choose Copy Channel ID.

Keep these handy for the config step.

Add the bot token to OpenClaw

You can pass the token as an environment variable or store it in your OpenClaw config. Environment variable is usually cleaner for ops since it’s easier to rotate.

Option A: environment variable

export DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN"

Option B: OpenClaw config

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN"
    }
  }
}

If you’re onboarding on a fresh LumaDock VPS you can follow our quickstart flow first, then come back here to add Discord. OpenClaw quickstart onboarding over SSH

Lock it down with allowlists and mention gating

This is the part most people skip, then wonder why OpenClaw is replying to everything. A safe default:

  • Disable DMs unless you really need them.
  • Allow only one server.
  • Allow only one channel.
  • Require a mention.

Example config:

{
  "channels": {
    "discord": {
      "enabled": true,
      "dm": { "enabled": false },
      "guilds": {
        "YOUR_GUILD_ID": {
          "requireMention": true,
          "channels": {
            "YOUR_CHANNEL_ID": { "allow": true, "requireMention": true }
          }
        }
      }
    }
  }
}

If you want DMs, keep pairing on. OpenClaw’s documentation and changelog describe pairing as the safer default for unknown senders.

Start OpenClaw and test in Discord

Start the gateway then send a test message from the allowed channel.

openclaw gateway --port 18789 --verbose

In Discord, in the allowed channel, mention the bot:

@YourBot hello

If it responds, you’re done. If it doesn’t, check the common failures below.

Troubleshooting that saves time

The bot doesn’t respond at all

  • Confirm the bot is online in your server’s member list.
  • Confirm the gateway is running on the VPS.
  • Confirm the token is correct (reset then update if you’re unsure).

It responds in some channels but not the one you want

  • Make sure that channel ID is allowlisted.
  • Make sure the bot has permission to view and write in that channel.

It only replies when I mention it

That’s expected if requireMention is enabled. It’s a good default for busy servers.

Messages look empty or OpenClaw “can’t see” content

Message Content is a privileged intent. Make sure it’s enabled in the Developer Portal. Without it, Discord does not forward message text to bots.

Good defaults for real teams

Once Discord is connected, the next improvements are mostly about noise control and blast radius:

  • Create one dedicated channel like #openclaw then expand only if there’s a real need.
  • Keep mention gating on in any public channel.
  • If you later enable DMs keep pairing enabled so strangers can’t spam your bot.
  • For anything that can run commands or touch infrastructure, isolate those tools and keep them out of “general chat” areas.

Your idea deserves better hosting

24/7 support 30-day money-back guarantee Cancel anytime
مدة الإشتراك

1 GB RAM VPS

$3.99 Save  50 %
$1.99 شهري
  • 1 vCPU AMD EPYC
  • 30 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • إدارة جدار الحماية
  • مراقبة مجانية

2 GB RAM VPS

$4.99 Save  20 %
$3.99 شهري
  • 2 vCPU AMD EPYC
  • 30 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • إدارة جدار الحماية
  • مراقبة مجانية

6 GB RAM VPS

$13.99 Save  29 %
$9.99 شهري
  • 6 vCPU AMD EPYC
  • 70 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • إدارة جدار الحماية
  • مراقبة مجانية

AMD EPYC VPS.P1

$6.99 Save  29 %
$4.99 شهري
  • 2 vCPU AMD EPYC
  • 4 GB ذاكرة RAM
  • 40 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

AMD EPYC VPS.P2

$12.99 Save  31 %
$8.99 شهري
  • 2 vCPU AMD EPYC
  • 8 GB ذاكرة RAM
  • 80 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

AMD EPYC VPS.P4

$25.99 Save  31 %
$17.99 شهري
  • 4 vCPU AMD EPYC
  • 16 GB ذاكرة RAM
  • 160 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

AMD EPYC VPS.P5

$32.49 Save  29 %
$22.99 شهري
  • 8 vCPU AMD EPYC
  • 16 GB ذاكرة RAM
  • 180 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

AMD EPYC VPS.P6

$48.99 Save  31 %
$33.99 شهري
  • 8 vCPU AMD EPYC
  • 32 GB ذاكرة RAM
  • 200 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

AMD EPYC VPS.P7

$61.99 Save  35 %
$39.99 شهري
  • 16 vCPU AMD EPYC
  • 32 GB ذاكرة RAM
  • 240 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

EPYC Genoa VPS.G1

$4.99 Save  20 %
$3.99 شهري
  • 1 vCPU AMD EPYC Gen4 معالج AMD EPYC Genoa من الجيل الرابع طراز 9xx4 بسرعة 3.25 جيجاهرتز أو ما يعادله، يعتمد على معمارية Zen 4.
  • 1 GB DDR5 ذاكرة
  • 25 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

EPYC Genoa VPS.G2

$9.99 Save  20 %
$7.99 شهري
  • 2 vCPU AMD EPYC Gen4 معالج AMD EPYC Genoa من الجيل الرابع طراز 9xx4 بسرعة 3.25 جيجاهرتز أو ما يعادله، يعتمد على معمارية Zen 4.
  • 4 GB DDR5 ذاكرة
  • 50 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

EPYC Genoa VPS.G4

$18.99 Save  32 %
$12.99 شهري
  • 4 vCPU AMD EPYC Gen4 معالج AMD EPYC Genoa من الجيل الرابع طراز 9xx4 بسرعة 3.25 جيجاهرتز أو ما يعادله، يعتمد على معمارية Zen 4.
  • 8 GB DDR5 ذاكرة
  • 100 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

EPYC Genoa VPS.G5

$29.99 Save  27 %
$21.99 شهري
  • 4 vCPU AMD EPYC Gen4 معالج AMD EPYC Genoa من الجيل الرابع طراز 9xx4 بسرعة 3.25 جيجاهرتز أو ما يعادله، يعتمد على معمارية Zen 4.
  • 16 GB DDR5 ذاكرة
  • 150 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

EPYC Genoa VPS.G6

$34.99 Save  23 %
$26.99 شهري
  • 8 vCPU AMD EPYC Gen4 معالج AMD EPYC Genoa من الجيل الرابع طراز 9xx4 بسرعة 3.25 جيجاهرتز أو ما يعادله، يعتمد على معمارية Zen 4.
  • 16 GB DDR5 ذاكرة
  • 200 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

EPYC Genoa VPS.G7

$57.99 Save  26 %
$42.99 شهري
  • 8 vCPU AMD EPYC Gen4 معالج AMD EPYC Genoa من الجيل الرابع طراز 9xx4 بسرعة 3.25 جيجاهرتز أو ما يعادله، يعتمد على معمارية Zen 4.
  • 32 GB DDR5 ذاكرة
  • 250 GB NVMe تخزين
  • نطاق ترددي غير محدود
  • IPv4 و IPv6 مضمّنان دعم IPv6 غير متوفر حالياً في فرنسا، فنلندا أو هولندا.
  • 1 Gbps شبكة
  • نسخ احتياطي تلقائي مضمّن
  • إدارة جدار الحماية
  • مراقبة مجانية

FAQ

Do I need to write any Discord bot code for this?

No. You create the bot in Discord’s portal and OpenClaw handles the rest using the token.

Automate faster, for less

Bring your winning ideas to life with AMD power, NVMe speed and unmetered bandwidth. Everything backed by 24/7 support, plus a 30-day refund period.