{"skill":{"slug":"agent-discord","displayName":"Agent Discord","summary":"Interact with Discord servers - send messages, read channels, manage reactions","description":"---\nname: agent-discord\ndescription: Interact with Discord servers - send messages, read channels, manage reactions\nversion: 1.10.5\nallowed-tools: Bash(agent-discord:*)\nmetadata:\n  openclaw:\n    requires:\n      bins:\n        - agent-discord\n    install:\n      - kind: node\n        package: agent-messenger\n        bins: [agent-discord]\n---\n\n# Agent Discord\n\nA TypeScript CLI tool that enables AI agents and humans to interact with Discord servers through a simple command interface. Features seamless token extraction from the Discord desktop app and multi-server support.\n\n## Quick Start\n\n```bash\n# Get server snapshot (credentials are extracted automatically)\nagent-discord snapshot\n\n# Send a message\nagent-discord message send <channel-id> \"Hello from AI agent!\"\n\n# List channels\nagent-discord channel list\n```\n\n## Authentication\n\nCredentials are extracted automatically from the Discord desktop app on first use. No manual setup required — just run any command and authentication happens silently in the background.\n\nOn macOS, the system may prompt for your Keychain password the first time (required to decrypt Discord's stored token). This is a one-time prompt.\n\n**IMPORTANT**: NEVER guide the user to open a web browser, use DevTools, or manually copy tokens from a browser. Always use `agent-discord auth extract` to obtain tokens from the desktop app.\n\n### Multi-Server Support\n\n```bash\n# List all available servers\nagent-discord server list\n\n# Switch to a different server\nagent-discord server switch <server-id>\n\n# Show current server\nagent-discord server current\n\n# Check auth status\nagent-discord auth status\n```\n\n## Memory\n\nThe agent maintains a `~/.config/agent-messenger/MEMORY.md` file as persistent memory across sessions. This is agent-managed — the CLI does not read or write this file. Use the `Read` and `Write` tools to manage your memory file.\n\n### Reading Memory\n\nAt the **start of every task**, read `~/.config/agent-messenger/MEMORY.md` using the `Read` tool to load any previously discovered server IDs, channel IDs, user IDs, and preferences.\n\n- If the file doesn't exist yet, that's fine — proceed without it and create it when you first have useful information to store.\n- If the file can't be read (permissions, missing directory), proceed without memory — don't error out.\n\n### Writing Memory\n\nAfter discovering useful information, update `~/.config/agent-messenger/MEMORY.md` using the `Write` tool. Write triggers include:\n\n- After discovering server IDs and names (from `server list`, `snapshot`, etc.)\n- After discovering useful channel IDs and names (from `channel list`, `snapshot`, etc.)\n- After discovering user IDs and names (from `user list`, `user me`, etc.)\n- After the user gives you an alias or preference (\"call this the dev server\", \"my main channel is X\")\n- After discovering channel structure (categories, voice channels)\n\nWhen writing, include the **complete file content** — the `Write` tool overwrites the entire file.\n\n### What to Store\n\n- Server IDs with names\n- Channel IDs with names and categories\n- User IDs with display names\n- User-given aliases (\"dev server\", \"announcements channel\")\n- Commonly used thread IDs\n- Any user preference expressed during interaction\n\n### What NOT to Store\n\nNever store tokens, credentials, or any sensitive data. Never store full message content (just IDs and channel context). Never store file upload contents.\n\n### Handling Stale Data\n\nIf a memorized ID returns an error (channel not found, server not found), remove it from `MEMORY.md`. Don't blindly trust memorized data — verify when something seems off. Prefer re-listing over using a memorized ID that might be stale.\n\n### Format / Example\n\n```markdown\n# Agent Messenger Memory\n\n## Discord Servers\n\n- `1234567890123456` — Acme Dev (default)\n- `9876543210987654` — Open Source Community\n\n## Channels (Acme Dev)\n\n- `1111111111111111` — #general (General category)\n- `2222222222222222` — #engineering (Engineering category)\n- `3333333333333333` — #deploys (Engineering category)\n\n## Users (Acme Dev)\n\n- `4444444444444444` — Alice (server owner)\n- `5555555555555555` — Bob\n\n## Aliases\n\n- \"dev server\" → `1234567890123456` (Acme Dev)\n- \"deploys\" → `3333333333333333` (#deploys in Acme Dev)\n\n## Notes\n\n- User prefers --pretty output for snapshots\n- Main server is \"Acme Dev\"\n```\n\n> Memory lets you skip repeated `channel list` and `server list` calls. When you already know an ID from a previous session, use it directly.\n\n## Commands\n\n### Auth Commands\n\n```bash\n# Extract token from Discord desktop app (usually automatic)\nagent-discord auth extract\nagent-discord auth extract --debug\n\n# Check auth status\nagent-discord auth status\n\n# Logout from Discord\nagent-discord auth logout\n```\n\n### Message Commands\n\n```bash\n# Send a message\nagent-discord message send <channel-id> <content>\nagent-discord message send 1234567890123456789 \"Hello world\"\n\n# List messages\nagent-discord message list <channel-id>\nagent-discord message list 1234567890123456789 --limit 50\n\n# Get a single message by ID\nagent-discord message get <channel-id> <message-id>\nagent-discord message get 1234567890123456789 9876543210987654321\n\n# Delete a message\nagent-discord message delete <channel-id> <message-id> --force\n\n# Acknowledge/mark a message as read\nagent-discord message ack <channel-id> <message-id>\n\n# Search messages in current server\nagent-discord message search <query>\nagent-discord message search \"project update\" --limit 10\nagent-discord message search \"hello\" --channel <channel-id> --author <user-id>\n```\n\n### Channel Commands\n\n```bash\n# List channels in current server (text channels only)\nagent-discord channel list\n\n# Get channel info\nagent-discord channel info <channel-id>\nagent-discord channel info 1234567890123456789\n\n# Get channel history (alias for message list)\nagent-discord channel history <channel-id> --limit 100\n```\n\n### Server Commands\n\n```bash\n# List all servers\nagent-discord server list\n\n# Get server info\nagent-discord server info <server-id>\n\n# Switch active server\nagent-discord server switch <server-id>\n\n# Show current server\nagent-discord server current\n```\n\n### User Commands\n\n```bash\n# List server members\nagent-discord user list\n\n# Get user info\nagent-discord user info <user-id>\n\n# Get current user\nagent-discord user me\n```\n\n### DM Commands\n\n```bash\n# List DM channels\nagent-discord dm list\n\n# Create a DM channel with a user\nagent-discord dm create <user-id>\n```\n\n### Mention Commands\n\n```bash\n# List recent mentions\nagent-discord mention list\nagent-discord mention list --limit 50\nagent-discord mention list --guild <server-id>\n```\n\n### Friend Commands\n\n```bash\n# List all relationships (friends, blocked, pending requests)\nagent-discord friend list\nagent-discord friend list --pretty\n```\n\n### Note Commands\n\n```bash\n# Get note for a user\nagent-discord note get <user-id>\n\n# Set note for a user\nagent-discord note set <user-id> \"Note content\"\n```\n\n### Profile Commands\n\n```bash\n# Get detailed user profile\nagent-discord profile get <user-id>\n```\n\n### Member Commands\n\n```bash\n# Search guild members\nagent-discord member search <guild-id> <query>\nagent-discord member search 1234567890123456789 \"john\" --limit 20\n```\n\n### Thread Commands\n\n```bash\n# Create a thread in a channel\nagent-discord thread create <channel-id> <name>\nagent-discord thread create 1234567890123456789 \"Discussion\" --auto-archive-duration 1440\n\n# Archive a thread\nagent-discord thread archive <thread-id>\n```\n\n### Reaction Commands\n\n```bash\n# Add reaction (use emoji name without colons)\nagent-discord reaction add <channel-id> <message-id> <emoji>\nagent-discord reaction add 1234567890123456789 9876543210987654321 thumbsup\n\n# Remove reaction\nagent-discord reaction remove <channel-id> <message-id> <emoji>\n\n# List reactions on a message\nagent-discord reaction list <channel-id> <message-id>\n```\n\n### File Commands\n\n```bash\n# Upload file\nagent-discord file upload <channel-id> <path>\nagent-discord file upload 1234567890123456789 ./report.pdf\n\n# List files in channel\nagent-discord file list <channel-id>\n\n# Get file info\nagent-discord file info <channel-id> <file-id>\n```\n\n### Snapshot Command\n\nGet comprehensive server state for AI agents:\n\n```bash\n# Full snapshot\nagent-discord snapshot\n\n# Filtered snapshots\nagent-discord snapshot --channels-only\nagent-discord snapshot --users-only\n\n# Limit messages per channel\nagent-discord snapshot --limit 10\n```\n\nReturns JSON with:\n- Server metadata (id, name)\n- Channels (id, name, type, topic)\n- Recent messages (id, content, author, timestamp)\n- Members (id, username, global_name)\n\n## Output Format\n\n### JSON (Default)\n\nAll commands output JSON by default for AI consumption:\n\n```json\n{\n  \"id\": \"1234567890123456789\",\n  \"content\": \"Hello world\",\n  \"author\": \"username\",\n  \"timestamp\": \"2024-01-15T10:30:00.000Z\"\n}\n```\n\n### Pretty (Human-Readable)\n\nUse `--pretty` flag for formatted output:\n\n```bash\nagent-discord channel list --pretty\n```\n\n## Key Differences from Slack\n\n| Feature | Discord | Slack |\n|---------|---------|-------|\n| Server terminology | Server | Workspace |\n| Channel identifiers | Snowflake IDs | Channel name or ID |\n| Message identifiers | Snowflake IDs | Timestamps (ts) |\n| Threads | Thread ID field | Thread timestamp |\n| Mentions | `<@user_id>` | `<@USER_ID>` |\n\n**Important**: Discord uses Snowflake IDs (large numbers like `1234567890123456789`) for all identifiers. You cannot use channel names directly - use `channel list` to find IDs first.\n\n## Common Patterns\n\nSee `references/common-patterns.md` for typical AI agent workflows.\n\n## Templates\n\nSee `templates/` directory for runnable examples:\n- `post-message.sh` - Send messages with error handling\n- `monitor-channel.sh` - Monitor channel for new messages\n- `server-summary.sh` - Generate server summary\n\n## Error Handling\n\nAll commands return consistent error format:\n\n```json\n{\n  \"error\": \"Not authenticated. Run \\\"auth extract\\\" first.\"\n}\n```\n\nCommon errors:\n- `Not authenticated`: No valid token (auto-extraction failed — see Troubleshooting)\n- `No current server set`: Run `server switch <id>` first\n- `Message not found`: Invalid message ID\n- `Unknown Channel`: Invalid channel ID\n\n## Configuration\n\nCredentials stored in: `~/.config/agent-messenger/discord-credentials.json`\n\nFormat:\n```json\n{\n  \"token\": \"user_token_here\",\n  \"current_server\": \"1234567890123456789\",\n  \"servers\": {\n    \"1234567890123456789\": {\n      \"server_id\": \"1234567890123456789\",\n      \"server_name\": \"My Server\"\n    }\n  }\n}\n```\n\n**Security**: File permissions set to 0600 (owner read/write only)\n\n## Limitations\n\n- No real-time events / Gateway connection\n- No voice channel support\n- No server management (create/delete channels, roles)\n- No slash commands\n- No webhook support\n- Plain text messages only (no embeds in v1)\n- User tokens only (no bot tokens)\n\n## Troubleshooting\n\n### Authentication fails or no token found\n\nCredentials are normally extracted automatically. If auto-extraction fails, run it manually with debug output:\n\n```bash\nagent-discord auth extract --debug\n```\n\nCommon causes:\n- Discord desktop app is not installed or not logged in\n- macOS Keychain access was denied (re-run and approve the prompt)\n- Discord is not running and LevelDB files are stale\n\n### `agent-discord: command not found`\n\n**`agent-discord` is NOT the npm package name.** The npm package is `agent-messenger`.\n\nIf the package is installed globally, use `agent-discord` directly:\n\n```bash\nagent-discord server list\n```\n\nIf the package is NOT installed, use `bunx agent-messenger discord`:\n\n```bash\nbunx agent-messenger discord server list\n```\n\n**NEVER run `bunx agent-discord`** — it will fail or install a wrong package since `agent-discord` is not the npm package name.\n\n## References\n\n- [Authentication Guide](references/authentication.md)\n- [Common Patterns](references/common-patterns.md)\n","tags":{"latest":"1.10.5"},"stats":{"comments":0,"downloads":981,"installsAllTime":1,"installsCurrent":1,"stars":0,"versions":12},"createdAt":1772526225322,"updatedAt":1779077560477},"latestVersion":{"version":"1.10.5","createdAt":1772811604649,"changelog":"- Bump version to 1.10.5\n- Documentation update only (SKILL.md): no code or functionality changes\n- No user-facing changes; all commands and usage remain the same","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"devxoul","userId":"s17e3f0kc1zca3444vg39rdjx183pefz","displayName":"Jeon Suyeol","image":"https://avatars.githubusercontent.com/u/931655?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089783895}}