← 返回 Skills 市场
devxoul

Agent Discord

作者 Jeon Suyeol · GitHub ↗ · v1.10.5
cross-platform ⚠ suspicious
562
总下载
0
收藏
1
当前安装
12
版本数
在 OpenClaw 中安装
/install agent-discord
功能描述
Interact with Discord servers - send messages, read channels, manage reactions
使用说明 (SKILL.md)

Agent Discord

A 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.

Quick Start

# Get server snapshot (credentials are extracted automatically)
agent-discord snapshot

# Send a message
agent-discord message send \x3Cchannel-id> "Hello from AI agent!"

# List channels
agent-discord channel list

Authentication

Credentials 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.

On 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.

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.

Multi-Server Support

# List all available servers
agent-discord server list

# Switch to a different server
agent-discord server switch \x3Cserver-id>

# Show current server
agent-discord server current

# Check auth status
agent-discord auth status

Memory

The 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.

Reading Memory

At 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.

  • If the file doesn't exist yet, that's fine — proceed without it and create it when you first have useful information to store.
  • If the file can't be read (permissions, missing directory), proceed without memory — don't error out.

Writing Memory

After discovering useful information, update ~/.config/agent-messenger/MEMORY.md using the Write tool. Write triggers include:

  • After discovering server IDs and names (from server list, snapshot, etc.)
  • After discovering useful channel IDs and names (from channel list, snapshot, etc.)
  • After discovering user IDs and names (from user list, user me, etc.)
  • After the user gives you an alias or preference ("call this the dev server", "my main channel is X")
  • After discovering channel structure (categories, voice channels)

When writing, include the complete file content — the Write tool overwrites the entire file.

What to Store

  • Server IDs with names
  • Channel IDs with names and categories
  • User IDs with display names
  • User-given aliases ("dev server", "announcements channel")
  • Commonly used thread IDs
  • Any user preference expressed during interaction

What NOT to Store

Never store tokens, credentials, or any sensitive data. Never store full message content (just IDs and channel context). Never store file upload contents.

Handling Stale Data

If 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.

Format / Example

# Agent Messenger Memory

## Discord Servers

- `1234567890123456` — Acme Dev (default)
- `9876543210987654` — Open Source Community

## Channels (Acme Dev)

- `1111111111111111` — #general (General category)
- `2222222222222222` — #engineering (Engineering category)
- `3333333333333333` — #deploys (Engineering category)

## Users (Acme Dev)

- `4444444444444444` — Alice (server owner)
- `5555555555555555` — Bob

## Aliases

- "dev server" → `1234567890123456` (Acme Dev)
- "deploys" → `3333333333333333` (#deploys in Acme Dev)

## Notes

- User prefers --pretty output for snapshots
- Main server is "Acme Dev"

Memory lets you skip repeated channel list and server list calls. When you already know an ID from a previous session, use it directly.

Commands

Auth Commands

# Extract token from Discord desktop app (usually automatic)
agent-discord auth extract
agent-discord auth extract --debug

# Check auth status
agent-discord auth status

# Logout from Discord
agent-discord auth logout

Message Commands

# Send a message
agent-discord message send \x3Cchannel-id> \x3Ccontent>
agent-discord message send 1234567890123456789 "Hello world"

# List messages
agent-discord message list \x3Cchannel-id>
agent-discord message list 1234567890123456789 --limit 50

# Get a single message by ID
agent-discord message get \x3Cchannel-id> \x3Cmessage-id>
agent-discord message get 1234567890123456789 9876543210987654321

# Delete a message
agent-discord message delete \x3Cchannel-id> \x3Cmessage-id> --force

# Acknowledge/mark a message as read
agent-discord message ack \x3Cchannel-id> \x3Cmessage-id>

# Search messages in current server
agent-discord message search \x3Cquery>
agent-discord message search "project update" --limit 10
agent-discord message search "hello" --channel \x3Cchannel-id> --author \x3Cuser-id>

Channel Commands

# List channels in current server (text channels only)
agent-discord channel list

# Get channel info
agent-discord channel info \x3Cchannel-id>
agent-discord channel info 1234567890123456789

# Get channel history (alias for message list)
agent-discord channel history \x3Cchannel-id> --limit 100

Server Commands

# List all servers
agent-discord server list

# Get server info
agent-discord server info \x3Cserver-id>

# Switch active server
agent-discord server switch \x3Cserver-id>

# Show current server
agent-discord server current

User Commands

# List server members
agent-discord user list

# Get user info
agent-discord user info \x3Cuser-id>

# Get current user
agent-discord user me

DM Commands

# List DM channels
agent-discord dm list

# Create a DM channel with a user
agent-discord dm create \x3Cuser-id>

Mention Commands

# List recent mentions
agent-discord mention list
agent-discord mention list --limit 50
agent-discord mention list --guild \x3Cserver-id>

Friend Commands

# List all relationships (friends, blocked, pending requests)
agent-discord friend list
agent-discord friend list --pretty

Note Commands

# Get note for a user
agent-discord note get \x3Cuser-id>

# Set note for a user
agent-discord note set \x3Cuser-id> "Note content"

Profile Commands

# Get detailed user profile
agent-discord profile get \x3Cuser-id>

Member Commands

# Search guild members
agent-discord member search \x3Cguild-id> \x3Cquery>
agent-discord member search 1234567890123456789 "john" --limit 20

Thread Commands

# Create a thread in a channel
agent-discord thread create \x3Cchannel-id> \x3Cname>
agent-discord thread create 1234567890123456789 "Discussion" --auto-archive-duration 1440

# Archive a thread
agent-discord thread archive \x3Cthread-id>

Reaction Commands

# Add reaction (use emoji name without colons)
agent-discord reaction add \x3Cchannel-id> \x3Cmessage-id> \x3Cemoji>
agent-discord reaction add 1234567890123456789 9876543210987654321 thumbsup

# Remove reaction
agent-discord reaction remove \x3Cchannel-id> \x3Cmessage-id> \x3Cemoji>

# List reactions on a message
agent-discord reaction list \x3Cchannel-id> \x3Cmessage-id>

File Commands

# Upload file
agent-discord file upload \x3Cchannel-id> \x3Cpath>
agent-discord file upload 1234567890123456789 ./report.pdf

# List files in channel
agent-discord file list \x3Cchannel-id>

# Get file info
agent-discord file info \x3Cchannel-id> \x3Cfile-id>

Snapshot Command

Get comprehensive server state for AI agents:

# Full snapshot
agent-discord snapshot

# Filtered snapshots
agent-discord snapshot --channels-only
agent-discord snapshot --users-only

# Limit messages per channel
agent-discord snapshot --limit 10

Returns JSON with:

  • Server metadata (id, name)
  • Channels (id, name, type, topic)
  • Recent messages (id, content, author, timestamp)
  • Members (id, username, global_name)

Output Format

JSON (Default)

All commands output JSON by default for AI consumption:

{
  "id": "1234567890123456789",
  "content": "Hello world",
  "author": "username",
  "timestamp": "2024-01-15T10:30:00.000Z"
}

Pretty (Human-Readable)

Use --pretty flag for formatted output:

agent-discord channel list --pretty

Key Differences from Slack

Feature Discord Slack
Server terminology Server Workspace
Channel identifiers Snowflake IDs Channel name or ID
Message identifiers Snowflake IDs Timestamps (ts)
Threads Thread ID field Thread timestamp
Mentions \x3C@user_id> \x3C@USER_ID>

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.

Common Patterns

See references/common-patterns.md for typical AI agent workflows.

Templates

See templates/ directory for runnable examples:

  • post-message.sh - Send messages with error handling
  • monitor-channel.sh - Monitor channel for new messages
  • server-summary.sh - Generate server summary

Error Handling

All commands return consistent error format:

{
  "error": "Not authenticated. Run \"auth extract\" first."
}

Common errors:

  • Not authenticated: No valid token (auto-extraction failed — see Troubleshooting)
  • No current server set: Run server switch \x3Cid> first
  • Message not found: Invalid message ID
  • Unknown Channel: Invalid channel ID

Configuration

Credentials stored in: ~/.config/agent-messenger/discord-credentials.json

Format:

{
  "token": "user_token_here",
  "current_server": "1234567890123456789",
  "servers": {
    "1234567890123456789": {
      "server_id": "1234567890123456789",
      "server_name": "My Server"
    }
  }
}

Security: File permissions set to 0600 (owner read/write only)

Limitations

  • No real-time events / Gateway connection
  • No voice channel support
  • No server management (create/delete channels, roles)
  • No slash commands
  • No webhook support
  • Plain text messages only (no embeds in v1)
  • User tokens only (no bot tokens)

Troubleshooting

Authentication fails or no token found

Credentials are normally extracted automatically. If auto-extraction fails, run it manually with debug output:

agent-discord auth extract --debug

Common causes:

  • Discord desktop app is not installed or not logged in
  • macOS Keychain access was denied (re-run and approve the prompt)
  • Discord is not running and LevelDB files are stale

agent-discord: command not found

agent-discord is NOT the npm package name. The npm package is agent-messenger.

If the package is installed globally, use agent-discord directly:

agent-discord server list

If the package is NOT installed, use bunx agent-messenger discord:

bunx agent-messenger discord server list

NEVER run bunx agent-discord — it will fail or install a wrong package since agent-discord is not the npm package name.

References

安全使用建议
This skill will extract your Discord user token from the desktop app and store it in ~/.config/agent-messenger/discord-credentials.json (plaintext), and it expects to read/write a persistent memory file (~/.config/agent-messenger/MEMORY.md) every run. Before installing or running it: 1) verify the package source (agent-messenger) and review its code on a trusted repo or npm page; 2) prefer using a bot token with scoped permissions rather than a user token (self-bots may violate Discord ToS); 3) if you proceed, run in an isolated account or VM, audit what the CLI writes under ~/.config, and ensure the credentials file is protected (chmod 600) and removed if you revoke access; 4) ask the publisher why config/credential paths are not declared in registry metadata and request a reproducible install provenance (package version, repository URL). The current mismatch between instructions and declared metadata is the main reason for caution.
功能分析
Type: OpenClaw Skill Name: agent-discord Version: 1.10.5 The skill bundle provides a CLI tool designed to perform 'seamless' authentication by automatically extracting Discord session tokens from the desktop application's local storage (LevelDB) on macOS, Linux, and Windows. While the documentation in SKILL.md and references/authentication.md is transparent about this behavior and its potential violation of Discord's Terms of Service, the automated harvesting of sensitive session credentials from the filesystem is a high-risk capability identical to techniques used by credential-stealing malware. There is no explicit evidence of data exfiltration to a third party, but the tool's core functionality relies on sensitive credential access and local persistence in ~/.config/agent-messenger/discord-credentials.json.
能力评估
Purpose & Capability
The skill's stated purpose (interact with Discord as the user) legitimately requires a user token and a CLI like agent-discord. However the registry metadata claims no required config paths or credentials while the SKILL.md and references explicitly instruct locating the Discord desktop app data, extracting the user token from LevelDB, and storing credentials at ~/.config/agent-messenger/discord-credentials.json — this undeclared local-file/credential access is an incoherence that reduces transparency.
Instruction Scope
SKILL.md and references explicitly instruct the tool/agent to extract tokens from the Discord desktop app (LevelDB Local Storage), to read a persistent memory file (~/.config/agent-messenger/MEMORY.md) at the start of every task using agent tools, and to write persistent memory. Those instructions involve accessing sensitive local files and credentials and directing the agent to read/write persistent state every run; this scope is broader than the registry metadata declares and contains potentially sensitive operations (automatic silent extraction).
Install Mechanism
Install spec is a Node package (agent-messenger) that provides the agent-discord binary — using npm is expected for a CLI. The package is not pinned to a specific verified source in metadata and provenance isn't provided; installing an unpinned npm package from an unknown owner increases supply-chain risk and should be audited before installation.
Credentials
The skill requests no environment variables, but it extracts and stores the user's Discord user token (sensitive credential) from local application storage and writes it plaintext to ~/.config/agent-messenger/discord-credentials.json. Storing user tokens in plaintext and performing automatic extraction without explicit declared config/credential requirements is disproportionate without clear user consent and provenance. The SKILL.md warns not to store tokens in memory files, but the tool itself will store them on disk.
Persistence & Privilege
The skill does not request always:true and is not set to be omnipresent, which is good. However it instructs the agent to maintain a persistent memory file and to read it at the start of every task; that persistent local state is not declared in the registry config paths. The combination (persistent local files + credential storage) increases blast radius if the package or CLI is compromised.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-discord
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-discord 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.10.5
- Bump version to 1.10.5 - Documentation update only (SKILL.md): no code or functionality changes - No user-facing changes; all commands and usage remain the same
v1.10.4
**Memory file integration guidelines and stricter authentication best practices.** - Add detailed guidance for agent-managed persistent memory using `~/.config/agent-messenger/MEMORY.md`, covering reading, writing, content format, and data hygiene. - Emphasize that the CLI never reads or writes the memory file—agents must manage it via the Read/Write tools only. - Add clear instructions to never direct users to extract tokens via their web browser or DevTools; always use `agent-discord auth extract` with the desktop app. - Include best practices for keeping memory up to date and avoiding use of stale IDs. - No CLI or API changes; documentation and best-practice improvements only.
v1.10.3
- Version updated to 1.10.3. - Documentation refreshed: SKILL.md updated to reflect the new version with no command or API changes.
v1.10.2
- Updated version to 1.10.2. - SKILL.md updated; no functional or usage changes documented for this release.
v1.10.1
- Documentation update only: version bumped from 1.10.0 to 1.10.1 in SKILL.md. - No functional or feature changes in this release.
v1.10.0
- Bump version to 1.10.0. - Documentation updates only; no feature or behavior changes.
v1.9.3
## agent-discord 1.9.3 Changelog - Documentation update only: SKILL.md improved to match the new version number (1.9.3). - No functional or command changes; only the version field was updated in documentation.
v1.9.2
- Documentation update: Bump version to 1.9.2 in SKILL.md. - No functional or feature changes; documentation and version information only.
v1.9.1
- Documentation update only: version bumped to 1.9.1 in SKILL.md. - No changes to features, commands, or functionality.
v1.9.0
- Version bumped to 1.9.0. - Documentation updated: SKILL.md now reflects the new version. - No functional or feature changes to commands or capabilities.
v1.8.1
- Added documentation for `auth logout` command and a dedicated "Auth Commands" section. - Clarified authentication and token extraction workflow in the command reference. - No changes to functionality or code—documentation-only update.
v1.8.0
**Expanded CLI and documentation for Discord automation via TypeScript.** - Added detailed SKILL.md, including comprehensive command references and usage examples for all supported features. - Expanded coverage: server, channel, message, user, DM, mention, friend, note, profile, member, thread, reaction, and file commands. - Improved multi-server support instructions and authentication guidance. - Included output format documentation (JSON and human-readable), error handling, and configuration details. - Updated limitations and troubleshooting sections for clearer guidance.
元数据
Slug agent-discord
版本 1.10.5
许可证
累计安装 1
当前安装数 1
历史版本数 12
常见问题

Agent Discord 是什么?

Interact with Discord servers - send messages, read channels, manage reactions. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 562 次。

如何安装 Agent Discord?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-discord」即可一键安装,无需额外配置。

Agent Discord 是免费的吗?

是的,Agent Discord 完全免费(开源免费),可自由下载、安装和使用。

Agent Discord 支持哪些平台?

Agent Discord 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Agent Discord?

由 Jeon Suyeol(@devxoul)开发并维护,当前版本 v1.10.5。

💬 留言讨论