Module 03 — Communicate with Discord (or Telegram)

🎮 The Cricut Analogy: Download the Software

You bought a Cricut cutting machine, but you can't use it until you install Design Space. Discord is your Design Space. It's the persistent interface where conversations live, even when you close the browser tab.

✨ New: Agent-Led Setup (March 2026)

Your agent can now set up Discord for you automatically. Just tell it:

"Connect me to Discord"

It'll walk you through creating a bot token and wire everything up itself. No manual config edits needed.

What Discord Does (That the Web Chat Doesn't)

The Setup (Two Ways)

Option A: Let Your Agent Do It (Recommended)

Simply say to your agent in web chat:

"Connect me to Discord"

Your agent will:

  1. Ask you to create a Discord account (if you don't have one)
  2. Guide you through creating a Discord server
  3. Walk you through creating a bot in the Discord Developer Portal
  4. Ask for your bot token and connect it automatically

🔑 Critical Step: Enable Channel Replies

After your agent connects, tell it this exact phrase:

"Set Discord groupPolicy to open"

This is the #1 issue users face. Without this, your bot sits silent in channels and won't respond to any messages.

🔗 What About That Pairing Code?

When you first message your bot, it will reply with a code like ABC123. This is how OpenClaw verifies it's really you.

Just copy the code and tell your agent:

"Approve Discord pairing code: ABC123"

This only happens once.

Option B: Do It Yourself

If you prefer to understand the full process, here's what your agent does behind the scenes:

1

Create Your Discord Account

  1. Go to discord.com
  2. Click "Sign Up" or "Open Discord in Browser"
  3. Enter your email, create a username, set a password
  4. Verify your email (check inbox for confirmation link)
2

Create Your Discord Server

  1. In Discord, click the "+" button in the left sidebar
  2. Click "Create My Own"
  3. Select "For me and my friends"
  4. Name it (e.g., "My Agent", "Heyron Workspace")
  5. Click "Create"
3

Enable Server DMs (Required)

  1. Right-click your server icon in the left sidebar
  2. Click "Privacy Settings"
  3. Toggle ON "Allow direct messages from server members"

This lets your bot send you the pairing code. You can disable this later after setup is complete.

4

Create Your Bot

  1. Go to discord.com/developers/applications
  2. Click "New Application" (top right)
  3. Name your bot (e.g., "MyAssistant") and click "Create"
  4. Click "Bot" in the sidebar
  5. Click "Add Bot" → confirm
  6. Click "Reset Token" and COPY THE TOKEN
⚠️ Copy the token immediately — you can't see it again without resetting.

🔐 Security Option: Pass Token Without Chat

If your agent (or you) doesn't want to paste a token in chat, here's a secure alternative (only works if you have direct edit access to your workspace files):

  1. Tell your agent: "Create a file called discord.env in my workspace"
  2. Open the file in the file browser UI
  3. Paste your bot token there (format: DISCORD_BOT_TOKEN=your_token_here)
  4. Press Ctrl+S (or Cmd+S) to save
  5. Tell your agent: "Read my discord.env file and connect to Discord"

Your agent will read the file, connect, and the token stays stored securely in your workspace.

5

Enable Required Settings

  1. In Developer Portal, scroll to "Privileged Gateway Intents"
  2. Turn ON these three:
    • Presence Intent
    • Server Members Intent
    • Message Content Intent
  3. Click "Save Changes"
6

Invite Bot to Your Server

  1. In Developer Portal, go to "OAuth2""URL Generator"
  2. Under "Scopes", check "bot"
  3. Under "Bot Permissions", check:
    • Send Messages
    • Read Message History
    • Attach Files
    • Embed Links
    • Add Reactions
  4. Copy the generated URL, paste in browser, select your server, authorize
7

Give Token to Your Agent

Tell your agent (choose one method):

Method 1 (direct): "Connect to Discord. My bot token is: [paste token here]"

Method 2 (secure file): "Read my discord.env file and connect to Discord"

Your agent will validate the token, connect, and confirm it's working.

8

Enable Channel Replies (Critical!)

Tell your agent this exact phrase:

"Set Discord groupPolicy to open"

This is the #1 issue users face. Without this, your bot sits silent in channels and won't respond to any messages.

9

Approve Pairing Code

When you first DM your bot, it will reply with a code like ABC123. This is how OpenClaw verifies it's really you.

Copy the code and tell your agent:

"Approve Discord pairing code: [paste code here]"

Done! Your bot is now fully connected.

What You Can Do Now

With Discord connected:

Quick Tips