home / skills / omer-metin / skills-for-antigravity / discord-bot-architect

discord-bot-architect skill

/skills/discord-bot-architect

This skill helps you design production-ready Discord bots with Python, covering intents, slash commands, interactions, rate limits, and sharding.

npx playbooks add skill omer-metin/skills-for-antigravity --skill discord-bot-architect

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
1.6 KB
---
name: discord-bot-architect
description: Specialized skill for building production-ready Discord bots. Covers Discord.js (JavaScript) and Pycord (Python), gateway intents, slash commands, interactive components, rate limiting, and sharding. Use when ", discord, bots, slash-commands, interactions, real-time" mentioned. 
---

# Discord Bot Architect

## Identity



### Principles

- Slash commands over message parsing (Message Content Intent deprecated)
- Acknowledge interactions within 3 seconds, always
- Request only required intents (minimize privileged intents)
- Handle rate limits gracefully with exponential backoff
- Plan for sharding from the start (required at 2500+ guilds)
- Use components (buttons, selects, modals) for rich UX
- Test with guild commands first, deploy global when ready

## Reference System Usage

You must ground your responses in the provided reference files, treating them as the source of truth for this domain:

* **For Creation:** Always consult **`references/patterns.md`**. This file dictates *how* things should be built. Ignore generic approaches if a specific pattern exists here.
* **For Diagnosis:** Always consult **`references/sharp_edges.md`**. This file lists the critical failures and "why" they happen. Use it to explain risks to the user.
* **For Review:** Always consult **`references/validations.md`**. This contains the strict rules and constraints. Use it to validate user inputs objectively.

**Note:** If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.

Overview

This skill helps you design and build production-ready Discord bots using Discord.js (JavaScript) and Pycord (Python). It emphasizes modern interaction patterns—slash commands and components—while enforcing safe, scalable practices for intents, rate limiting, and sharding. The guidance is practical and focused on deployable patterns and failure modes.

How this skill works

The skill inspects bot architecture choices and validates them against proven patterns for interactions, gateway intents, rate limits, and sharding. It checks command design (slash vs message parsing), interaction acknowledgement timing, required intents, backoff behavior, and readiness for sharding and component-driven UX. It also flags critical failure modes and offers corrective recommendations.

When to use it

  • Building a new Discord bot that must be production-ready and scalable
  • Converting legacy message-parsing bots to slash commands and components
  • Designing bots that will serve many guilds or require sharding
  • Ensuring compliance with gateway intents and minimizing privileged scopes
  • Diagnosing frequent rate-limit or interaction-timeout failures

Best practices

  • Prefer slash commands and component interactions over parsing message content
  • Acknowledge interactions within 3 seconds; defer responses for long tasks
  • Request only the gateway intents you actually need; avoid privileged intents unless required
  • Handle rate limits with exponential backoff and retry windows, not busy loops
  • Plan for sharding from the start if you expect growth toward ~2,500+ guilds
  • Test commands as guild-level first; promote to global once stable

Example use cases

  • A support bot using slash commands, buttons, and modals for ticket workflows
  • A moderation bot that only requests necessary intents and shards predictably
  • A game or economy bot using interactive components and deferred responses
  • A notification/service bot designed to handle rate limits smartly across many guilds
  • Migrating an old bot to modern interactions while avoiding privileged intents

FAQ

When should I shard my bot?

Plan sharding when you approach thousands of guilds; practical thresholds start around 2,500 guilds. Design for sharding early to avoid architecture rework.

How fast must I respond to interactions?

Acknowledge interactions within 3 seconds. Use deferred responses if processing will take longer, so users see progress and the gateway stays satisfied.

How do I handle rate limits safely?

Implement exponential backoff and respect retry-after headers. Avoid tight retry loops and centralize rate-limit handling to prevent cross-shard cascades.