360 Secure SkillHub
360 安全技能中心

Discord Context

该 Skill 通过 Node CLI 命令拉取 Discord 论坛活动线程并刷新本地缓存,可列出或查看单个线程的缓存上下文,并将线程关联到工作区 memory/ 下的记忆文件;缓存与读写均限制在 workspace 内,需 DISCORD_TOKEN 及线程、服务器、论坛 ID,且 ID 与文件名格式受校验。

demitrim
demitrim
热度 79.73
最近更新 2026-05-11 17:25:49
分类:协作依赖:代码执行 / 读写文件 / 第三方 API应用场景:工作流 / 笔记整理 / 任务管理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add discord-context
Metadata
name
discord-context
description
Sync and cache per-thread context for Discord Forum channels. Use when handling /discord-context commands to poll active threads, list cached context, inspect a thread cache, or link a thread to a memory QMD file.
user-invocable
true
metadata
{"openclaw":{"requires":{"bins":["node"],"env":["DISCORD_TOKEN"]}}}

discord-context

Run node {baseDir}/scripts/discord-context-cli.js <command> ....

Commands

  • poll [--guild <id>] [--forum <id>] [--workspace <path>]

    • Pull active threads from Discord and refresh cache for new/updated threads.
    • Requires DISCORD_TOKEN plus guild/forum IDs (flags or env vars).
  • context [threadId] [--workspace <path>] [--json]

    • Without threadId: list cached threads.
    • With threadId: print cached context and metadata for one thread.
  • link <threadId> <qmdName> [--workspace <path>]

    • Link a thread to memory/<qmdName>.md and refresh cached context text.

Environment

  • DISCORD_TOKEN (required for poll)
  • DISCORD_GUILD_ID (default guild id for poll)
  • DISCORD_FORUM_CHANNEL_ID (default forum id for poll)
  • OPENCLAW_WORKSPACE (defaults to ~/.openclaw/workspace)

Security Rules

  • Never hardcode Discord tokens.
  • Accept only numeric thread/guild/forum IDs.
  • Accept only [a-zA-Z0-9_-]+ for qmdName.
  • Keep all reads/writes inside the workspace memory/ tree.

Paths

  • Cache metadata: memory/discord-cache/thread-<id>.json
  • Cache text: memory/discord-cache/thread-<id>-context.txt
  • Source context files: memory/*.md