discord-reader
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDiscord Skill (Read-Only)
Discord 技能(只读模式)
Reads Discord for financial research using discord-cli, a command-line tool that syncs Discord messages locally and provides search, analytics, and export capabilities.
This skill is read-only. It is designed for financial research: searching trading server discussions, monitoring crypto/market groups, tracking sentiment in financial communities, and exporting messages for analysis. It does NOT support sending messages, reacting, editing, deleting, or any write operations.
Important: This tool uses your Discord token extracted from a local Discord client or browser session. No bot account needed.
使用discord-cli读取Discord内容以开展金融研究,这是一款可将Discord消息同步到本地,并提供搜索、分析和导出功能的命令行工具。
本技能为只读模式。它专为金融研究设计:可搜索交易服务器中的讨论内容、监控加密货币/市场群组、追踪金融社区中的市场情绪,以及导出消息用于分析。不支持发送消息、添加反应、编辑、删除或任何写入操作。
重要提示:本工具会使用从本地Discord客户端或浏览器会话中提取的Discord令牌,无需机器人账号。
Step 1: Ensure discord-cli Is Installed and Authenticated
步骤1:确保discord-cli已安装并完成认证
Current environment status:
!`(command -v discord && discord status 2>&1 | head -5 && echo "AUTH_OK" || echo "AUTH_NEEDED") 2>/dev/null || echo "NOT_INSTALLED"`If the status above shows , skip to Step 2. If , install first:
AUTH_OKNOT_INSTALLEDbash
undefined当前环境状态:
!`(command -v discord && discord status 2>&1 | head -5 && echo "AUTH_OK" || echo "AUTH_NEEDED") 2>/dev/null || echo "NOT_INSTALLED"`如果上述状态显示,则跳至步骤2。如果显示,请先安装:
AUTH_OKNOT_INSTALLEDbash
undefinedInstall (requires Python 3.10+)
安装(需要Python 3.10+)
uv tool install kabi-discord-cli
If `AUTH_NEEDED`, guide the user:uv tool install kabi-discord-cli
如果显示`AUTH_NEEDED`,请按以下步骤引导用户:Authentication
认证流程
Method A: Auto-extract from local Discord client (recommended)
bash
discord auth --saveThis extracts the token from the locally running Discord desktop app or browser session and saves it for future use.
Method B: Environment variable
bash
export DISCORD_TOKEN="<token from browser DevTools>"
discord status方法A:从本地Discord客户端自动提取(推荐)
bash
discord auth --save此命令会从本地运行的Discord桌面应用或浏览器会话中提取令牌并保存,供后续使用。
方法B:通过环境变量设置
bash
export DISCORD_TOKEN="<从浏览器开发者工具获取的令牌>"
discord statusCommon auth issues
常见认证问题
| Symptom | Fix |
|---|---|
| Open Discord desktop app or login in browser, then run |
| Re-login to Discord and run |
| Token is invalid — re-extract with |
| 症状 | 解决方法 |
|---|---|
| 打开Discord桌面应用或在浏览器中登录,然后运行 |
| 重新登录Discord,再运行 |
| 令牌无效——使用 |
Step 2: Identify What the User Needs
步骤2:明确用户需求
Match the user's request to one of the read commands below, then use the corresponding command from .
references/commands.md| User Request | Command | Key Flags |
|---|---|---|
| Auth check | | — |
| Who am I | | |
| List servers/guilds | | |
| List channels in a server | | |
| Server info | | |
| Server members | | |
| Fetch message history | | |
| Sync messages locally | | |
| Sync all channels | | |
| Tail (live/latest) | | |
| Search server (API) | | |
| Search locally | | |
| Recent messages | | |
| Today's messages | | |
| Message stats | | |
| Top senders | | |
| Activity timeline | | |
| Export messages | | |
将用户的请求与下方的只读命令匹配,然后使用中的对应命令。
references/commands.md| 用户请求 | 命令 | 关键参数 |
|---|---|---|
| 检查认证状态 | | — |
| 查看当前账号信息 | | |
| 列出服务器/公会 | | |
| 列出服务器中的频道 | | |
| 服务器信息 | | |
| 服务器成员 | | |
| 获取消息历史 | | |
| 同步消息到本地 | | |
| 同步所有频道 | | |
| 实时查看最新消息 | | |
| 服务器端搜索(API) | | |
| 本地搜索 | | |
| 近期消息 | | |
| 今日消息 | | |
| 消息统计 | | |
| 高频发言用户 | | |
| 活动时间线 | | |
| 导出消息 | | `-f text |
Step 3: Execute the Command
步骤3:执行命令
General pattern
通用格式
bash
undefinedbash
undefinedUse --json or --yaml for structured output
如需结构化输出,使用--json或--yaml参数
discord dc guilds --json
discord dc channels GUILD_ID --json
discord dc guilds --json
discord dc channels GUILD_ID --json
Sync messages from a channel for local queries
同步指定频道的消息到本地,用于后续查询
discord dc sync CHANNEL_ID -n 1000
discord dc sync CHANNEL_ID -n 1000
Search for financial topics
搜索金融相关话题
discord dc search GUILD_ID "AAPL earnings" --json
discord search "BTC pump" -n 20 --json
discord dc search GUILD_ID "AAPL earnings" --json
discord search "BTC pump" -n 20 --json
Recent activity
查看近期活动
discord recent --hours 24 -n 50 --json
discord today -c CHANNEL_ID --json
undefineddiscord recent --hours 24 -n 50 --json
discord today -c CHANNEL_ID --json
undefinedKey rules
核心规则
- Check auth first — run before any other command
discord status - Use or
--jsonfor structured output when processing data programmatically--yaml - Sync before local queries — run before using
discord dc sync CHANNEL_ID,discord search, etc.discord recent - Use to limit results — start with 50–100 unless the user asks for more
-n N - Use for server-side search (no sync needed); use
discord dc searchfor local search (requires prior sync)discord search - Use with
--hours N,recent,top, andtimelineto scope by time windowexport - NEVER execute write operations — this skill is read-only; do not send messages, react, edit, delete, or manage server settings
- NEVER run — this deletes local data and is not relevant for research
discord purge
- 先检查认证状态 —— 在执行任何其他命令前,先运行
discord status - 使用--json或--yaml —— 当需要以编程方式处理数据时,使用结构化输出格式
- 本地查询前先同步 —— 在使用、
discord search等命令前,先运行discord recentdiscord dc sync CHANNEL_ID - 使用-n N限制结果数量 —— 除非用户要求更多,否则默认返回50-100条结果
- 区分搜索方式 —— 使用进行服务器端搜索(无需同步);使用
discord dc search进行本地搜索(需提前同步)discord search - 使用--hours N限定时间范围 —— 在、
recent、top和timeline命令中使用该参数来缩小时间范围export - 禁止执行写入操作 —— 本技能为只读模式;请勿发送消息、添加反应、编辑、删除内容或管理服务器设置
- 禁止执行discord purge命令 —— 该命令会删除本地数据,与研究需求无关
Output flags
输出参数说明
| Flag | Purpose |
|---|---|
| JSON output |
| YAML output (default in non-TTY) |
| Limit number of results |
| Save output to file |
| Filter by channel |
| 参数 | 用途 |
|---|---|
| 输出JSON格式内容 |
| 输出YAML格式内容(非终端环境下的默认格式) |
| 限制结果数量 |
| 将输出保存到文件 |
| 按频道筛选 |
Typical workflow for a new server
新服务器的典型操作流程
bash
undefinedbash
undefined1. List guilds to find the server
1. 列出所有服务器以找到目标服务器
discord dc guilds --json
discord dc guilds --json
2. List channels in the target guild
2. 列出目标服务器中的频道
discord dc channels GUILD_ID --json
discord dc channels GUILD_ID --json
3. Sync messages from channels of interest
3. 同步感兴趣的频道消息
discord dc sync CHANNEL_ID -n 2000
discord dc sync CHANNEL_ID -n 2000
4. Search or analyze
4. 进行搜索或分析
discord search "price target" -n 20 --json
discord recent -c CHANNEL_ID --hours 24 --json
discord top -c CHANNEL_ID --hours 168 --json
---discord search "price target" -n 20 --json
discord recent -c CHANNEL_ID --hours 24 --json
discord top -c CHANNEL_ID --hours 168 --json
---Step 4: Present the Results
步骤4:展示结果
After fetching data, present it clearly for financial research:
- Summarize key content — highlight the most relevant messages for the user's financial research
- Include attribution — show username, message content, and timestamp
- For search results, group by relevance and highlight key themes, sentiment, or market signals
- For server/channel listings, present as a clean table with names and IDs
- Flag sentiment — note bullish/bearish sentiment, consensus vs contrarian views
- For analytics (,
stats,top), present activity patterns and notable contributorstimeline - Treat tokens as secrets — never echo Discord tokens to stdout
获取数据后,需以清晰的格式呈现以支持金融研究:
- 总结关键内容 —— 突出与用户金融研究最相关的消息
- 标注来源信息 —— 显示用户名、消息内容和时间戳
- 搜索结果分组 —— 按相关性分组,突出关键主题、市场情绪或信号
- 服务器/频道列表 —— 以整洁的表格形式展示名称和ID
- 标记市场情绪 —— 标注看多/看空情绪、共识与对立观点
- 分析类结果(stats、top、timeline) —— 展示活动模式和重要贡献者
- 令牌保密 —— 切勿将Discord令牌输出到标准输出流
Step 5: Diagnostics
步骤5:问题排查
If authentication fails, re-run:
bash
discord auth --save
discord statusEnsure Discord desktop app is running or you are logged into Discord in a browser.
如果认证失败,重新运行:
bash
discord auth --save
discord status确保Discord桌面应用正在运行,或已在浏览器中登录Discord。
Error Reference
错误参考
| Error | Cause | Fix |
|---|---|---|
| Not authenticated | Run |
| HTTP 401 | Token expired/invalid | Re-login to Discord and re-extract token |
| HTTP 403 | No access to resource | Verify you have access to the server/channel |
| HTTP 429 | Rate limited | Wait a few minutes, then retry |
| 错误 | 原因 | 解决方法 |
|---|---|---|
| 未完成认证 | 打开Discord后运行 |
| HTTP 401 | 令牌过期/无效 | 重新登录Discord并重新提取令牌 |
| HTTP 403 | 无资源访问权限 | 确认你拥有该服务器/频道的访问权限 |
| HTTP 429 | 请求频率受限 | 等待几分钟后重试 |
Reference Files
参考文件
- — Complete read command reference with all flags and usage examples
references/commands.md
Read the reference file when you need exact command syntax or detailed flag descriptions.
- —— 完整的只读命令参考,包含所有参数和使用示例
references/commands.md
当你需要准确的命令语法或详细的参数说明时,请查阅该参考文件。