Discord

From OpenHands/extensions · View interactive version

Discord is an AI agent skill from the GitHub repository OpenHands/extensions. Build and automate Discord integrations (bots, webhooks, slash commands, and REST API workflows). Use when the user mentions Discord, a Discord server/guild, channels, webhooks, bot tokens, slash commands/application commands, discord.js, or discord.py.

How to use this skill

Skill file

Discord

Use this skill when implementing or automating Discord integrations.

Pick the right approach

  1. Incoming webhooks (best for one-way posting)
  1. Bot token + REST API (two-way / richer automation)
  1. Interactions / slash commands (user-invoked commands)

Secrets & safety

Footguns / safety notes (read this)

Quick recipes

The shell snippets below use POSIX-style environment variables and line continuations. On Windows PowerShell, use curl.exe for the shown flags and $env:DISCORD_WEBHOOK_URL / $env:DISCORD_BOT_TOKEN for environment variables, or translate the request to Invoke-RestMethod.

Post a message via an incoming webhook (recommended)

Discord requires at least one of content, embeds, components, file, or poll.

curl -sS -X POST \
  -H 'Content-Type: application/json' \
  -d '{"content":"Hello from OpenHands","allowed_mentions":{"parse":[]}}' \
  "$DISCORD_WEBHOOK_URL"

Post a message to a channel with a bot token

Endpoint: POST /channels/{channel_id}/messages (Create Message)

CHANNEL_ID="..."

curl -sS -X POST "https://discord.com/api/v10/channels/${CHANNEL_ID}/messages" \
  -H "Authorization: Bot $DISCORD_BOT_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"content":"Hello from my bot","allowed_mentions":{"parse":[]}}'

Docs: https://discord.com/developers/docs/resources/channel#create-message

Automation scripts (bundled)

These scripts are self-contained and only use the Python standard library.

```bash

python3 -m skills.discord.scripts.post_webhook --content "Build finished" --wait

```

```bash

python3 -m skills.discord.scripts.send_message --channel-id "$CHANNEL_ID" --content "Hello"

```

Rate limits

Docs: https://discord.com/developers/docs/topics/rate-limits

Slash commands / application commands

Docs: https://discord.com/developers/docs/interactions/application-commands

Reference

For more details (OAuth2 flows, command registration endpoints, troubleshooting), see:

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.