运行时依赖
安装命令
点击复制技能文档
代理 Discord
A TypeScript 命令行工具 工具 that enables AI 代理s and humans to interact with Discord servers through a simple command interface. Features seamless 令牌 提取ion from the Discord 桌面 应用 and multi-server support.
Quick 启动 # 获取 server snapshot (凭证s are 提取ed automatically) 代理-discord snapshot
# 发送 a message 代理-discord message 发送 "Hello from AI 代理!"
# 列出 channels 代理-discord channel 列出
Authentication
凭证s are 提取ed automatically from the Discord 桌面 应用 on first use. No manual 设置up required — just 运行 any command and authentication h应用ens silently in the background.
On macOS, the 系统 may prompt for your KeychAIn password the first time (required to 解密 Discord's stored 令牌). This is a one-time prompt.
导入ANT: NEVER 图形界面de the user to open a 网页 browser, use Dev工具s, or manually copy 令牌s from a browser. Always use 代理-discord auth 提取 to obtAIn 令牌s from the 桌面 应用.
Multi-Server Support # 列出 all avAIlable servers 代理-discord server 列出
# Switch to a different server 代理-discord server switch
# Show current server 代理-discord server current
# 检查 auth 状态 代理-discord auth 状态
Memory
The 代理 mAIntAIns a ~/.config/代理-messenger/MEMORY.md file as persistent memory across 会话s. This is 代理-managed — the 命令行工具 does not read or write this file. Use the Read and Write 工具s to manage your memory file.
Reading Memory
At the 启动 of every task, read ~/.config/代理-messenger/MEMORY.md using the Read 工具 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 创建 it when you first have useful in格式化ion to store. If the file can't be read (权限s, missing directory), proceed without memory — don't error out. Writing Memory
After discovering useful in格式化ion, 更新 ~/.config/代理-messenger/MEMORY.md using the Write 工具. Write triggers include:
After discovering server IDs and names (from server 列出, snapshot, etc.) After discovering useful channel IDs and names (from channel 列出, snapshot, etc.) After discovering user IDs and names (from user 列出, 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 工具 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 令牌s, 凭证s, or any sensitive data. Never store full message content (just IDs and channel 上下文). Never store file 上传 contents.
Handling Stale Data
If a memorized ID returns an error (channel not found, server not found), 移除 it from MEMORY.md. Don't blindly trust memorized data — 验证 when something seems off. Prefer re-列出ing over using a memorized ID that might be stale.
格式化 / Example # 代理 Messenger Memory
Discord Servers
1234567890123456— Acme Dev (default)9876543210987654— Open Source Community
Channels (Acme Dev)
1111111111111111— #general (General category)2222222222222222— #engineering (Engineering category)3333333333333333— #部署s (Engineering category)
Users (Acme Dev)
4444444444444444— Alice (server owner)5555555555555555— Bob
Aliases
- "dev server" →
1234567890123456(Acme Dev) - "部署s" →
3333333333333333(#部署s in Acme Dev)
Notes
- User prefers --pretty 输出 for snapshots
- MAIn server is "Acme Dev"
Memory lets you skip repeated channel 列出 and server 列出 calls. When you already know an ID from a previous 会话, use it directly.
Commands Auth Commands # 提取 令牌 from Discord 桌面 应用 (usually automatic) 代理-discord auth 提取 代理-discord auth 提取 --调试
# 检查 auth 状态 代理-discord auth 状态
# 记录out from Discord 代理-discord auth 记录out
Message Commands # 发送 a message 代理-discord message 发送 代理-discord message 发送 1234567890123456789 "Hello world"
# 列出 messages 代理-discord message 列出 代理-discord message 列出 1234567890123456789 --limit 50
# 获取 a single message by ID 代理-discord message 获取 代理-discord message 获取 1234567890123456789 9876543210987654321
# 删除 a message 代理-discord message 删除 --force
# Acknowledge/mark a message as read 代理-discord message ack
# 搜索 messages in current server 代理-discord message 搜索 <查询> 代理-discord message 搜索 "project 更新" --limit 10 代理-discord message 搜索 "hello" --channel --author