discord-reader

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Discord 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
AUTH_OK
, skip to Step 2. If
NOT_INSTALLED
, install first:
bash
undefined
当前环境状态
!`(command -v discord && discord status 2>&1 | head -5 && echo "AUTH_OK" || echo "AUTH_NEEDED") 2>/dev/null || echo "NOT_INSTALLED"`
如果上述状态显示
AUTH_OK
,则跳至步骤2。如果显示
NOT_INSTALLED
,请先安装:
bash
undefined

Install (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 --save
This 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 status

Common auth issues

常见认证问题

SymptomFix
Token not found
Open Discord desktop app or login in browser, then run
discord auth --save
Token expired / invalid
Re-login to Discord and run
discord auth --save
again
Unauthorized (401)
Token is invalid — re-extract with
discord auth --save

症状解决方法
Token not found
打开Discord桌面应用或在浏览器中登录,然后运行
discord auth --save
Token expired / invalid
重新登录Discord,再运行
discord auth --save
Unauthorized (401)
令牌无效——使用
discord auth --save
重新提取

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 RequestCommandKey Flags
Auth check
discord status
Who am I
discord whoami
--json
List servers/guilds
discord dc guilds
--json
List channels in a server
discord dc channels GUILD_ID
--json
Server info
discord dc info GUILD_ID
--json
Server members
discord dc members GUILD_ID
--max N
,
--json
Fetch message history
discord dc history CHANNEL_ID
-n N
Sync messages locally
discord dc sync CHANNEL_ID
-n N
Sync all channels
discord dc sync-all
-n N
Tail (live/latest)
discord dc tail CHANNEL_ID
--once
Search server (API)
discord dc search GUILD_ID "QUERY"
-c CHANNEL_ID
,
--json
Search locally
discord search "QUERY"
-c CHANNEL
,
-n N
,
--json
Recent messages
discord recent
-c CHANNEL
,
--hours N
,
-n N
,
--json
Today's messages
discord today
-c CHANNEL
,
--json
Message stats
discord stats
--json
Top senders
discord top
-c CHANNEL
,
--hours N
,
--json
Activity timeline
discord timeline
-c CHANNEL
,
--hours N
,
--by day|hour
,
--json
Export messages
discord export CHANNEL
-f text|json
,
-o FILE
,
--hours N

将用户的请求与下方的只读命令匹配,然后使用
references/commands.md
中的对应命令。
用户请求命令关键参数
检查认证状态
discord status
查看当前账号信息
discord whoami
--json
列出服务器/公会
discord dc guilds
--json
列出服务器中的频道
discord dc channels GUILD_ID
--json
服务器信息
discord dc info GUILD_ID
--json
服务器成员
discord dc members GUILD_ID
--max N
,
--json
获取消息历史
discord dc history CHANNEL_ID
-n N
同步消息到本地
discord dc sync CHANNEL_ID
-n N
同步所有频道
discord dc sync-all
-n N
实时查看最新消息
discord dc tail CHANNEL_ID
--once
服务器端搜索(API)
discord dc search GUILD_ID "QUERY"
-c CHANNEL_ID
,
--json
本地搜索
discord search "QUERY"
-c CHANNEL
,
-n N
,
--json
近期消息
discord recent
-c CHANNEL
,
--hours N
,
-n N
,
--json
今日消息
discord today
-c CHANNEL
,
--json
消息统计
discord stats
--json
高频发言用户
discord top
-c CHANNEL
,
--hours N
,
--json
活动时间线
discord timeline
-c CHANNEL
,
--hours N
, `--by day
导出消息
discord export CHANNEL
`-f text

Step 3: Execute the Command

步骤3:执行命令

General pattern

通用格式

bash
undefined
bash
undefined

Use --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
undefined
discord recent --hours 24 -n 50 --json discord today -c CHANNEL_ID --json
undefined

Key rules

核心规则

  1. Check auth first — run
    discord status
    before any other command
  2. Use
    --json
    or
    --yaml
    for structured output when processing data programmatically
  3. Sync before local queries — run
    discord dc sync CHANNEL_ID
    before using
    discord search
    ,
    discord recent
    , etc.
  4. Use
    -n N
    to limit results — start with 50–100 unless the user asks for more
  5. Use
    discord dc search
    for server-side search (no sync needed); use
    discord search
    for local search (requires prior sync)
  6. Use
    --hours N
    with
    recent
    ,
    top
    ,
    timeline
    , and
    export
    to scope by time window
  7. NEVER execute write operations — this skill is read-only; do not send messages, react, edit, delete, or manage server settings
  8. NEVER run
    discord purge
    — this deletes local data and is not relevant for research
  1. 先检查认证状态 —— 在执行任何其他命令前,先运行
    discord status
  2. 使用--json或--yaml —— 当需要以编程方式处理数据时,使用结构化输出格式
  3. 本地查询前先同步 —— 在使用
    discord search
    discord recent
    等命令前,先运行
    discord dc sync CHANNEL_ID
  4. 使用-n N限制结果数量 —— 除非用户要求更多,否则默认返回50-100条结果
  5. 区分搜索方式 —— 使用
    discord dc search
    进行服务器端搜索(无需同步);使用
    discord search
    进行本地搜索(需提前同步)
  6. 使用--hours N限定时间范围 —— 在
    recent
    top
    timeline
    export
    命令中使用该参数来缩小时间范围
  7. 禁止执行写入操作 —— 本技能为只读模式;请勿发送消息、添加反应、编辑、删除内容或管理服务器设置
  8. 禁止执行discord purge命令 —— 该命令会删除本地数据,与研究需求无关

Output flags

输出参数说明

FlagPurpose
--json
JSON output
--yaml
YAML output (default in non-TTY)
-n N
Limit number of results
-o FILE
Save output to file
-c CHANNEL
Filter by channel
参数用途
--json
输出JSON格式内容
--yaml
输出YAML格式内容(非终端环境下的默认格式)
-n N
限制结果数量
-o FILE
将输出保存到文件
-c CHANNEL
按频道筛选

Typical workflow for a new server

新服务器的典型操作流程

bash
undefined
bash
undefined

1. 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:
  1. Summarize key content — highlight the most relevant messages for the user's financial research
  2. Include attribution — show username, message content, and timestamp
  3. For search results, group by relevance and highlight key themes, sentiment, or market signals
  4. For server/channel listings, present as a clean table with names and IDs
  5. Flag sentiment — note bullish/bearish sentiment, consensus vs contrarian views
  6. For analytics (
    stats
    ,
    top
    ,
    timeline
    ), present activity patterns and notable contributors
  7. Treat tokens as secrets — never echo Discord tokens to stdout

获取数据后,需以清晰的格式呈现以支持金融研究:
  1. 总结关键内容 —— 突出与用户金融研究最相关的消息
  2. 标注来源信息 —— 显示用户名、消息内容和时间戳
  3. 搜索结果分组 —— 按相关性分组,突出关键主题、市场情绪或信号
  4. 服务器/频道列表 —— 以整洁的表格形式展示名称和ID
  5. 标记市场情绪 —— 标注看多/看空情绪、共识与对立观点
  6. 分析类结果(stats、top、timeline) —— 展示活动模式和重要贡献者
  7. 令牌保密 —— 切勿将Discord令牌输出到标准输出流

Step 5: Diagnostics

步骤5:问题排查

If authentication fails, re-run:
bash
discord auth --save
discord status
Ensure Discord desktop app is running or you are logged into Discord in a browser.

如果认证失败,重新运行:
bash
discord auth --save
discord status
确保Discord桌面应用正在运行,或已在浏览器中登录Discord。

Error Reference

错误参考

ErrorCauseFix
Token not found
Not authenticatedRun
discord auth --save
with Discord open
HTTP 401Token expired/invalidRe-login to Discord and re-extract token
HTTP 403No access to resourceVerify you have access to the server/channel
HTTP 429Rate limitedWait a few minutes, then retry

错误原因解决方法
Token not found
未完成认证打开Discord后运行
discord auth --save
HTTP 401令牌过期/无效重新登录Discord并重新提取令牌
HTTP 403无资源访问权限确认你拥有该服务器/频道的访问权限
HTTP 429请求频率受限等待几分钟后重试

Reference Files

参考文件

  • references/commands.md
    — Complete read command reference with all flags and usage examples
Read the reference file when you need exact command syntax or detailed flag descriptions.
  • references/commands.md
    —— 完整的只读命令参考,包含所有参数和使用示例
当你需要准确的命令语法或详细的参数说明时,请查阅该参考文件。