with one click
discord
Discord 社区数据查询:频道消息、成员列表、线程
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Discord 社区数据查询:频道消息、成员列表、线程
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Figma 设计文件查询:读取文件结构、导出界面截图、查看组件和样式
GitLab 代码仓库数据查询:提交记录、Merge Request、项目成员、用户活跃度
生成交互式 HTML 可视化(图表、流程图、UI原型、数据仪表盘、演示页等)
将自己的 Skill 分享给同事或部门,管理已分享的 Skill
浏览、搜索、安装、卸载所有 Skill(系统/共享/个人)
查询 DataEye AdXray 广告透视平台数据,包括产品投放趋势、媒体分布、热门排行、新品排行、搜索产品等
| name | Discord社区 |
| description | Discord 社区数据查询:频道消息、成员列表、线程 |
| triggers | ["Discord","DC","DC社区","DC频道","DC消息","DC成员","DC数据","社区数据","社区监控","玩家社区","设置Discord"] |
| tool | tools/discord_api.py |
| default | false |
| credentials | {"section":"discord","fields":[{"name":"bot_token","label":"Bot Token","help":"从 Discord Developer Portal 的 Bot 页面生成"},{"name":"guild_id","label":"Guild ID","help":"右键 Discord 服务器 → 复制服务器 ID"}]} |
通过 Discord REST API 查询社区数据:频道列表、历史消息、成员信息、活跃线程。凭证通过环境变量注入(per-user credentials.yaml)。
本文件位于
skills/discord/,下文中的相对路径均基于项目根目录。
pip install requests
使用前需先设置 Discord Bot Token 和 Guild ID:
python3 tools/discord_api.py setup --bot-token "YOUR_BOT_TOKEN" --guild-id "YOUR_GUILD_ID"
Bot Token 从 Discord Developer Portal → 你的应用 → Bot 页面获取。Guild ID 在 Discord 客户端开启开发者模式后,右键服务器 → 复制服务器 ID。
tools/discord_api.py(从 TyClaw 项目根目录运行)
python3 tools/discord_api.py get-guild
# 所有频道
python3 tools/discord_api.py list-channels
# 只看文字频道
python3 tools/discord_api.py list-channels --type 0
# 只看论坛频道
python3 tools/discord_api.py list-channels --type 15
# 最近 50 条
python3 tools/discord_api.py get-messages --channel-id "1384476930090340362"
# 最近 100 条
python3 tools/discord_api.py get-messages --channel-id "1384476930090340362" --limit 100
# 某条消息之后的新消息(定时轮询用)
python3 tools/discord_api.py get-messages --channel-id "1384476930090340362" --after "1494153919952322581"
# 某条消息之前的历史消息
python3 tools/discord_api.py get-messages --channel-id "1384476930090340362" --before "1494153919952322581"
# 列出成员(最多 1000)
python3 tools/discord_api.py list-members --limit 100
# 翻页(传上一页最后一个 user_id)
python3 tools/discord_api.py list-members --limit 100 --after "123456789"
# 按名称搜索成员
python3 tools/discord_api.py search-members --query "suike"
python3 tools/discord_api.py list-threads
| 参数 | 说明 |
|---|---|
--guild-id | 可选,覆盖默认服务器 ID |
| ID | 类型 |
|---|---|
| 0 | 文字频道 |
| 2 | 语音频道 |
| 4 | 分类 |
| 5 | 公告频道 |
| 13 | Stage 频道 |
| 15 | 论坛频道 |
| 参数 | 说明 | 默认值 |
|---|---|---|
--channel-id | 频道或线程 ID | (必填) |
--limit | 消息数量(1-100) | 50 |
--before | 此消息 ID 之前 | - |
--after | 此消息 ID 之后 | - |
--around | 此消息 ID 前后 | - |
| 字段 | 说明 |
|---|---|
id | 消息 ID |
author_id | 发送者用户 ID |
author_name | 发送者用户名 |
author_bot | 是否是机器人 |
content | 消息内容 |
timestamp | 发送时间 |
reactions | 表情反应列表 |
reply_to | 回复的原始消息(如有) |
thread_id | 关联的线程 ID(如有) |
创建定时任务,每小时拉取 bug-report 频道的新消息并汇总到钉钉:
--after 参数只拉增量创建每日定时任务:
list-channels 获取所有频道get-messages --limit 100 拉取当日消息list-members 遍历获取全部成员get-messages 统计发言频次list-members 需要 Bot 开启 SERVER MEMBERS Privileged Intentget-messages 读取消息内容需要 Bot 开启 MESSAGE CONTENT Privileged Intent