discord-server

Manage a Discord server via CLI commands. Use this skill whenever the user mentions Discord, wants to post messages, manage channels or roles, check member lists, send embeds, or do anything related to Discord server management. Trigger phrases: "post to Discord", "check the server", "announce", "who's in the Discord", "create a channel", "set up a role", "manage server", "assign role", "send message to Discord", "read Discord messages".

Discord Server Management

Manage a Discord server via CLI scripts in commands/. 18 stateless commands (read, write, destructive) that connect, execute, and disconnect. All output is JSON. Pass --help to any command for usage info.

Prerequisites

Bot token in .env must be valid and the bot must be in the server with Manage Channels, Manage Roles, and Send Messages permissions.

Available Commands

All commands are run as:

node commands/<command>.mjs <args>

Read Operations (safe, no side effects)

CommandUsagePurpose
server-info.mjsnode commands/server-info.mjsServer overview: members, channels, roles, boost level
list-channels.mjsnode commands/list-channels.mjsAll channels grouped by category with topics
list-members.mjsnode commands/list-members.mjsAll human members with roles and join dates
read-messages.mjsnode commands/read-messages.mjs <channel> [--limit N]Read recent messages (default 10, max 100)
list-roles.mjsnode commands/list-roles.mjsAll roles with name, color, member count, hoisted status
list-threads.mjsnode commands/list-threads.mjs <channel>Active threads in a channel

Write Operations (create content, non-destructive)

CommandUsagePurpose
send-message.mjsnode commands/send-message.mjs <channel> <message>Send a message to any channel
send-embed.mjsnode commands/send-embed.mjs <channel> --title "..." --description "..." [--field "Name|Value"] [--color #hex] [--footer "..."]Send a rich branded embed
edit-message.mjsnode commands/edit-message.mjs <channel> <message-id> <new-content>Edit a bot message
create-channel.mjsnode commands/create-channel.mjs <category> <name> [--topic "..."] [--read-only]Create a text channel under a category
create-thread.mjsnode commands/create-thread.mjs <channel> <thread-name> [--message-id ID]Create a thread, optionally from a message
set-topic.mjsnode commands/set-topic.mjs <channel> <topic>Update a channel's topic
create-role.mjsnode commands/create-role.mjs <name> [--color #hex] [--hoist]Create a new role
assign-role.mjsnode commands/assign-role.mjs <username> <role-name>Assign an existing role to a member
remove-role.mjsnode commands/remove-role.mjs <username> <role-name>Remove a role from a member
pin-message.mjsnode commands/pin-message.mjs <channel> <message-id>Pin a message in a channel

Destructive Operations (require --confirm flag)

These commands will not execute without the --confirm flag. Always ask the user for explicit confirmation before running destructive operations.

CommandUsagePurpose
delete-channel.mjsnode commands/delete-channel.mjs <channel> --confirmDelete a channel permanently
delete-role.mjsnode commands/delete-role.mjs <role-name> --confirmDelete a role permanently

Output Format

All commands return JSON to stdout. Successful operations include { "ok": true, ... }. Errors include { "error": "description" }. Parse the output to confirm success before reporting to the user.

Common Workflows

Post an announcement:

node commands/send-message.mjs announcements "New release is live. Check the changelog."

Send a branded embed:

node commands/send-embed.mjs announcements --title "UPDATE" --description "New features deployed." --field "Status|Live"

Read recent messages:

node commands/read-messages.mjs general --limit 20

Assign a role to a member:

node commands/assign-role.mjs "username" "Admin"

Create a discussion thread:

node commands/create-thread.mjs chat "Weekly Discussion"

Add a new channel:

node commands/create-channel.mjs GENERAL "off-topic" --topic "Anything goes"

Check server health:

node commands/server-info.mjs