discord

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已安装并完成认证

Before running any command, install and check auth:
bash
undefined
运行任何命令前,请先安装并检查认证状态:
bash
undefined

Install (requires Python 3.10+)

安装(需要Python 3.10+)

command -v discord || uv tool install kabi-discord-cli
command -v discord || uv tool install kabi-discord-cli

Check authentication

检查认证状态

discord status && echo "AUTH_OK" || echo "AUTH_NEEDED"

If `AUTH_OK`, skip to Step 2. If `AUTH_NEEDED`, guide the user:
discord status && echo "AUTH_OK" || echo "AUTH_NEEDED"

如果显示`AUTH_OK`,直接跳至步骤2。如果显示`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|hour
,
--json
导出消息
discord export CHANNEL
-f text|json
,
-o FILE
,
--hours N

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
    —— 完整的只读命令参考,包含所有参数和使用示例
当需要准确的命令语法或详细的参数说明时,请查阅该参考文件。