Discord bot

From rianvdm/product-ai-public · View interactive version

Discord bot is an AI agent skill from the GitHub repository rianvdm/product-ai-public. Discord bot development on Cloudflare Workers — Discord API, Developer Portal, slash commands, Gateway WebSocket, Interactions Endpoint, bot permissions, intents, and Ed25519 verification.

How to use this skill

Skill file

Discord Bot Development

Use this skill when working on Discord bots, Discord API integration, bot setup/configuration, or slash command registration. Triggered by mentions of Discord bots, Discord Developer Portal, Discord API, slash commands, Gateway, or Interactions Endpoint.

Search before giving portal instructions

The Discord Developer Portal UI changes often, so web-search current instructions before describing:

Useful queries:

If search results are older than 6 months, note this to the user and suggest they verify in the portal.

Discord Bot Architecture on Cloudflare Workers

Two models for receiving Discord events:

Interactions Endpoint (HTTP)

Gateway (WebSocket)

Which Do You Need?

| Feature | Interactions Endpoint | Gateway |

|---------|----------------------|---------|

| Slash commands | Yes | Not needed |

| Message reactions | No | Required |

| Message content | No | Required (with intent) |

| Typing indicators | No | Required |

| Presence updates | No | Required |

| Voice state | No | Required |

Most bots need both: Interactions Endpoint for slash commands, Gateway for real-time events.

Setting Up a New Discord Bot

1. Create Application

2. Get Bot Token

3. Configure Installation

4. Set Interactions Endpoint

5. Register Slash Commands

6. Install to Server

Intents

Gateway intents control which events Discord sends to your bot.

Standard intents (no approval needed):

Privileged intents (must be enabled in Developer Portal → Bot):

No approval needed for bots in <100 servers. Over 100 servers requires Discord review.

Common Permissions

| Permission | Bit | When needed |

|-----------|-----|-------------|

| View Channels | 1 << 10 | See channels and receive events from them |

| Send Messages | 1 << 11 | Send messages (DMs, channel messages) |

| Read Message History | 1 << 16 | Fetch messages via REST API |

| Use Slash Commands | 1 << 31 | Use application commands |

| Manage Roles | 1 << 28 | Assign/remove roles from members |

| Add Reactions | 1 << 6 | Add reactions to messages |

Common Gotchas

Bot doesn't receive reaction events

Empty message.content from REST API

Slash command not visible

"The application did not respond" on a slash command that actually worked

WebSocket connection drops on Cloudflare Workers

Discord rate limits

Verification Checklist

When setting up or debugging a Discord bot:

Reference: Elereada v2

Working example of a Discord bot on Cloudflare Workers: github.com/rianvdm/elereada-v2

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.