Runs Discord bot actions (post, reply, kick, ban, list channels) through your existing bot connector after checking permissions and confirming each write, or outputs the API request.
---
name: discord-bot-controller
description: Plans and runs Discord bot actions such as posting or replying to messages, creating channels, and kicking or banning members through a Discord bot connector or bot token the user already configured, checking the bot's permissions first and confirming every write. Without a connector it outputs the exact Discord API request to run. Use when asked to post to a Discord channel, moderate a member or manage a Discord server with a bot.
compatibility: Needs an existing Discord bot (with a token held by a connector or the agent's environment) that has been added to the server with the required permissions. This skill does not create bots or store tokens.
metadata:
version: "1.0.0"
category: "Automation"
---
# Discord Bot Controller
Translates a request into a specific Discord API action, checks that the bot is allowed to do it, shows the request, and executes it only after confirmation.
## When to use / when not to
- Use for: sending a message to a channel or thread, replying to a message, creating a text channel, kicking or banning a member, listing channels.
- Do not use for: acting with a user account (self-bots break Discord's terms), mass-messaging members, or bypassing a server's moderation rules.
## Inputs to collect
- Server (guild) and channel: IDs are best. If only names are given, resolve them with a list call and show the match.
- Action and its content: message text (up to 2000 characters per message), reply target message ID, member user ID and reason for moderation.
- For bans: whether to delete recent messages (`delete_message_seconds`, 0 to 604800 seconds).
## Workflow
1. Identify the tool: a Discord connector or MCP server in the client, or a bot token already present in the environment (for example `DISCORD_BOT_TOKEN`). Never ask the user to paste the token into chat.
2. Map the request to one endpoint:
| Action | Endpoint | Bot permission |
|---|---|---|
| Send message | `POST /channels/{channel.id}/messages` | `SEND_MESSAGES` (plus `READ_MESSAGE_HISTORY` for replies) |
| Kick member | `DELETE /guilds/{guild.id}/members/{user.id}` | `KICK_MEMBERS` |
| Ban member | `PUT /guilds/{guild.id}/bans/{user.id}` | `BAN_MEMBERS` |
| List channels | `GET /guilds/{guild.id}/channels` | must be in the server |
3. Check permissions before writing. If the bot lacks the permission or its highest role is below the target member's role, stop and explain what the server admin must change.
4. Show the request and get an explicit yes. For kicks and bans, restate the member, server and reason, and say whether the action can be undone (a ban can be lifted later; a kick removes the member immediately).
5. Execute. Send the moderation reason in the `X-Audit-Log-Reason` header so it appears in the audit log. Set `allowed_mentions` so a message cannot ping `@everyone` or roles unless the user asked for it.
6. Report the result returned by the API (message ID, HTTP status, error code). On HTTP 429, wait for the `retry_after` value before one retry; do not loop.
## Without a connector
Output the method, path, headers (with `Authorization: Bot $DISCORD_BOT_TOKEN` as a placeholder) and JSON body, plus a one-line `curl` the user can run. State that nothing was sent.
## Safety and limits
- Every write needs confirmation; moderation needs the target, reason and server restated.
- Respect rate limits: Discord allows bots about 50 requests per second globally plus per-route limits, and repeated 401/403/429 responses can get the bot's IP temporarily blocked.
- Do not bulk-kick, bulk-ban or DM members unless the user lists each target and confirms.
- Messages over 2000 characters must be split or shortened; ask which.
## Example
Request: "Post 'Maintenance tonight 22:00-23:00 UTC' in #announcements on the Builders server, no pings."
Result: channel ID resolved and shown, `POST /channels/<id>/messages` with `{"content": "Maintenance tonight 22:00-23:00 UTC", "allowed_mentions": {"parse": []}}` displayed, sent after confirmation, and the returned message ID reported.
Generate a GitHub Actions (or other CI) pipeline from the repo's real scripts, with least-privilege permissions, caching, concurrency and a gated deploy.
Generate a compose.yaml for your app, database and cache with health-checked startup, named volumes and secrets in .env, validated with docker compose config.
Automate notifications and alerts
Illustrative input and expected result. This example is a verification guide, not a recorded model run.
Content reviewed .
A community manager whose agent client has a Discord bot connector wants a maintenance notice posted without pinging everyone.
Post 'Maintenance tonight 22:00-23:00 UTC' in #announcements on the Builders server. Don't ping anyone.
The agent resolves #announcements to a channel ID and shows it, checks the bot can send messages there, then displays POST /channels/<id>/messages with body {"content": "Maintenance tonight 22:00-23:00 UTC", "allowed_mentions": {"parse": []}}. After 'yes' it sends once and reports the message ID returned. A request to ban a member instead triggers a restatement of member, server and reason, a BAN_MEMBERS and role-hierarchy check, and an X-Audit-Log-Reason header.AI Agent Skills are reusable workflow packages that extend your AI coding assistant with multi-step capabilities. Install Discord Bot Controller by following these steps.
SKILL.md inside, in the location documented by your client. Do not assume every AI application reads the same directory.Requires an Agent Skills-compatible client; supported locations and activation vary by version. Read the SKILL.md setup guide. MCP connects tools and data and does not, by itself, install a skill.
Generate a GitHub Actions (or other CI) pipeline from the repo's real scripts, with least-privilege permissions, caching, concurrency and a gated deploy.
Generate a compose.yaml for your app, database and cache with health-checked startup, named volumes and secrets in .env, validated with docker compose config.
Automate notifications and alerts