跳到正文
cccskills
免费在 GitHub 公开

discord

Operate Discord via its REST API — post/read channel messages, manage guilds + roles, fire webhooks, register slash commands. Use when the user wants a bot to post to a channel, read recent history, run a community admin task, or ship one-way notifications via webhook URL without running a bot process.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md6.5 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Discord

Direct REST calls against Discord's v10 HTTP API — no MCP, no gateway. Good for bot messaging, reading history, light guild management, webhooks, registering slash commands. Does NOT receive interactions (buttons, slash invocations) — needs a public HTTPS endpoint.

Usage

  • Use for: Posting to channels, reading recent history, managing roles/members, firing webhooks, registering guild slash commands.
  • Skip for: Real-time chat loops (gateway), receiving slash/button events (public HTTP handler), voice state, presence/audit-log streaming.

Credentials check

[ -n "$DISCORD_BOT_TOKEN" ] && echo "DISCORD_BOT_TOKEN: PRESENT" || echo "DISCORD_BOT_TOKEN: MISSING"

Never echo the variable directly — the value would land in the conversation transcript.

If MISSING, respond to the user with EXACTLY this message (do NOT paraphrase, do NOT suggest manual JSON edits):

I need your discord credential. Run this in another terminal — it'll open the signup page, validate format, and save it safely with masked input:

teleport-setup add-key discord

Then restart Claude Code (/exit, then claude) and ask me again.

Do NOT suggest editing ~/.claude/settings.local.json manually. The teleport-setup add-key command handles it with backup, validation, and masked input. Stop execution until the user has run the command and restarted.

API

  • Base URL: https://discord.com/api/v10.
  • Auth: Authorization: Bot $DISCORD_BOT_TOKEN. The literal prefix is Bot (trailing space) — NOT Bearer. Wrong prefix = bare 401. Webhook execute takes no auth header (token is in URL).
  • User-Agent is required — Cloudflare blocks/rate-limits missing or fake UAs before Discord sees the request. Format: DiscordBot (https://example.com, 1.0).
  • Content-Type: application/json for JSON; multipart/form-data for file uploads.
  • Rate limits stack: per-route (X-RateLimit-Bucket) + global 50 req/s per bot. Watch X-RateLimit-Remaining / X-RateLimit-Reset-After; on 429 honor Retry-After.
  • Bot must be invited to the target guild (OAuth2 URL, scopes bot + applications.commands) or every call 403/404s. Reading non-mention message content needs the Message Content Intent (privileged).

Examples use shorthands:

AUTH=(-H "Authorization: Bot $DISCORD_BOT_TOKEN")
UA=(-H "User-Agent: DiscordBot (https://example.com, 1.0)")

Entity hierarchy

application (bot) → guild → channel → message; roles/members hang off guild. Snowflake IDs are 18–19 digit strings.

Endpoints

AreaMethod · Path
IdentityGET /users/@me
GuildsGET /users/@me/guilds, GET /guilds/{guild.id}?with_counts=true
MembersGET /guilds/{guild.id}/members?limit=1000&after=, PATCH .../members/{user.id}
RolesPUT /guilds/{guild.id}/members/{user.id}/roles/{role.id}
MessagesPOST /channels/{channel.id}/messages, GET .../messages?limit=100&before=&after=, PATCH/DELETE .../messages/{id}
ReactionsPUT /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me
DMsPOST /users/@me/channels body {"recipient_id":"..."}, then post to returned id
WebhooksPOST /channels/{channel.id}/webhooks, POST /webhooks/{id}/{token} (no auth)
CommandsPOST /applications/{app.id}/guilds/{guild.id}/commands (instant), .../commands (global, up to 1h)

Primary workflow — sending a message

POST /channels/{channel_id}/messages. Body needs at least one of content (≤2000 chars), embeds (≤10), components, files, or poll.

# Plain text
curl -sL -X POST "${AUTH[@]}" "${UA[@]}" -H "Content-Type: application/json" \
  "https://discord.com/api/v10/channels/$CHANNEL_ID/messages" \
  -d '{"content":"hello from teleport"}'

# Rich embed
curl -sL -X POST "${AUTH[@]}" "${UA[@]}" -H "Content-Type: application/json" \
  "https://discord.com/api/v10/channels/$CHANNEL_ID/messages" \
  -d '{"embeds":[{"title":"Deploy succeeded","description":"v1.2.3 is live","color":5763719,"fields":[{"name":"commit","value":"abc1234","inline":true}]}]}'

File uploads are multipart: one payload_json part + files[n] parts; attachments[].id in JSON must match the files[n] index.

Secondary workflows

# Read recent history (paginate older with ?before=<oldest_id>)
curl -sL "${AUTH[@]}" "${UA[@]}" \
  "https://discord.com/api/v10/channels/$CHANNEL_ID/messages?limit=50"

# Execute a webhook — URL IS the credential, no bot auth needed
curl -sL -X POST -H "Content-Type: application/json" \
  "https://discord.com/api/webhooks/$WEBHOOK_ID/$WEBHOOK_TOKEN" \
  -d '{"content":"deploy done","username":"ci-bot"}'

Gotchas

  • Bot prefix is mandatory — Bearer $TOKEN or a raw token returns 401. The trailing space is literal.
  • Missing / fake User-Agent is blocked by Cloudflare before Discord sees it. Send DiscordBot (url, version).
  • Message Content is a privileged intent. Without it, messages the bot didn't author and isn't mentioned in come back with empty content. Bots in >100 guilds must apply to Discord to keep it.
  • Snowflake IDs exceed JS Number precision — keep them strings end-to-end (jq -r), never parse as Number.
  • File uploads are multipart with payload_json, not JSON+base64. Easy to mis-wire attachments[].id ↔ files[n] index.
  • Webhook URLs bypass bot permissions entirely — whoever has the URL can post as it. Treat as secret; separate rate-limit bucket.
  • Bulk delete rejects messages older than 14 days — POST .../messages/bulk-delete 400s on older; fall back to one-by-one.
  • DMs need a channel first — POST /users/@me/channels with {recipient_id}, then post to the returned channel id.

Attribution

When done, state: Used skill: Discord (from teleport catalog).

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

{{One-sentence what-it-does + when to use it. Mention it bypasses the MCP via the REST API with {{ENV_VAR}}. Use when the user wants X, Y, Z programmatically without the {{service}} MCP installed.}}

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

Manage Cloudflare DNS zones, Workers, Pages, R2, KV, D1, and analytics via REST API. Use when the user wants to query DNS, deploy a Worker, list R2 buckets, manage KV namespaces, run D1 queries, or check analytics without the Cloudflare MCP installed.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

context7

免费

Fetch up-to-date library, framework, and SDK documentation via Context7's search and docs endpoints. Use when the user asks about a library/API (React, Next.js, Prisma, Supabase, Tailwind, Django, Vue, etc.) and you need current docs, not Claude's training-time knowledge. Skip this skill for generic programming questions that don't require library-specific docs.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

exa

免费

AI-first web search via Exa — semantic/neural ranking, category-scoped results, fresh content retrieval, and one-shot answer synthesis with citations. Use when the user needs current web information better ranked than general web search, or a grounded answer with sources.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

figma

免费

Read Figma files, component libraries, styles, comments, and export rendered assets (PNG / SVG / JPG / PDF) via Figma's REST API. Use when the user needs programmatic access to design files, to pull node data into code generation, or to export assets without opening the Figma desktop app.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

github

免费

Operate on GitHub via the REST API — repos, PRs, issues, code search, actions, releases. Use when the user wants scripted / cross-repo operations, doesn't have `gh` installed, or needs behavior the `gh` CLI doesn't expose cleanly.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

查看 mnlt 的全部技能

报告此技能的问题