discord-bot

discord-bot is a skill for OpenCode from rianvdm/product-ai-public. It costs 40 tokens per session (1,941 once invoked), scanned A, original, MIT.

A guide for building Discord bots on Cloudflare Workers. Discord is a chat platform, and bots are programs that respond to messages or commands there.

In plain words
What is it for?
Use it to connect a bot to Discord, add slash commands, receive events, configure permissions and intents, and verify incoming requests.
Why use it?
It brings the Discord setup, security checks, permissions, and Cloudflare deployment details together in one workflow.

Skill for OpenCode

Written for OpenCode: installed under .opencode/.

Good fit Use it to connect a bot to Discord, add slash commands, receive events, configure permissions and intents, and verify incoming requests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rianvdm/product-ai-public/discord-bot
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rianvdm/product-ai-public --skill discord-bot
Clone the repo
git clone --depth 1 https://github.com/rianvdm/product-ai-public

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for discord-bot

README.md
[![agentmods](https://agentmods.dev/badge/skills/rianvdm/product-ai-public/discord-bot/github.svg)](https://agentmods.dev/skills/rianvdm/product-ai-public/discord-bot)
Your own site
<a href="https://agentmods.dev/skills/rianvdm/product-ai-public/discord-bot"><img src="https://agentmods.dev/badge/skills/rianvdm/product-ai-public/discord-bot/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for discord-bot

Your own site · 80×15
<a href="https://agentmods.dev/skills/rianvdm/product-ai-public/discord-bot"><img src="https://agentmods.dev/badge/skills/rianvdm/product-ai-public/discord-bot.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,941 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01941
Opus 5 $0.00020 $0.00971
Sonnet 5 $0.00008 $0.00388
Haiku 4.5 $0.00004 $0.00194

Measured 11d ago against content hash 0a7d75dec795, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

discord-bot scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/skills/discord-bot/SKILL.md · 169 lines

How it starts

The opening of the file, as written. The whole thing — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

The Discord Developer Portal UI changes frequently. Do NOT rely on pre-trained knowledge for:

  • Where settings are located in the Developer Portal
  • OAuth2 flow steps
  • Bot permission configuration
  • Interactions Endpoint setup
  • Install link generation

Always web search first for any Developer Portal instructions. Use queries like:

  • Discord Developer Portal [specific task] 2026 (include the current year)
  • Discord bot setup [specific feature] latest

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)

  • Discord POSTs slash commands and component interactions to your Worker URL
  • No persistent connection needed — pure request/response
  • Set the URL in Developer Portal → General Information → Interactions Endpoint URL
  • Requires Ed25519 signature verification on every request (discord-interactions npm package)
  • Supports: slash commands, buttons, select menus, modals, autocomplete

Gateway (WebSocket)

  • Persistent WebSocket connection to wss://gateway.discord.gg
  • Required for: reaction events, message events, presence, voice state, typing indicators
  • On Cloudflare Workers: use a Durable Object with new WebSocket(url) for the outbound connection
  • NOT fetch() with Upgrade: websocket — that doesn't work for wss:// URLs
  • DO won't hibernate while outbound WS is open — use alarm-based keepalive (30s interval)
  • Deploys evict the DO; alarm reconnects within ~30 seconds

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

Read the full file on GitHub · 169 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 169 lines · 40 tokens per session scan A 0a7d75dec795

Subscribe to this mod's changes

discord-bot is a skill published in the GitHub repository rianvdm/product-ai-public (16 stars, last pushed 2d ago), licensed MIT. It adds 40 tokens to every session and 1,941 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

stripe-projects

Provision SaaS services + sync creds via Stripe Projects.

NousResearch/hermes-agent · 15 tokens

azure-eventhub-dotnet

Azure Event Hubs SDK for .NET. Use for high-throughput event streaming: sending events (EventHubProducerClient, EventHubBufferedProducerClient), receiving events (EventProcessorClient with checkpointing), partition management, and real-time data ingestion. Triggers: "Event Hubs", "event streaming"…

microsoft/skills · 94 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

cve

Look up CVE records via x cve — cached, zero-API-key, daily xz TSV. Load for cve, vulnerability id, kev, epss, nvd, cvelist, or security advisory.

x-cmd/x-cmd · 49 tokens

wikipedia

Search and read Wikipedia via x wkp — MediaWiki API, no API key, zero install; query, extract, suggest, and DDG route in one module. Load for wiki, wikipedia, encyclopedia lookup, article summary.

x-cmd/x-cmd · 49 tokens

django-storages-s3

Use when configuring Django to store static and media files on AWS S3 with django-storages. Invoke when working with the STORAGES setting, S3 buckets, presigned URLs, CloudFront, or boto3-backed file storage in settings.py. Configures the Django 4.2+ STORAGES dict, public/private custom backends, presigned GET/POST…

Jeffallan/claude-skills · 138 tokens