discord-context
// 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.
$ git log --oneline --stat
stars:1,933
forks:367
updated:March 4, 2026
SKILL.mdreadonly
SKILL.md Frontmatter
namediscord-context
descriptionSync 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-invocabletrue
metadata[object Object]
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_TOKENplus 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.
- Without
-
link <threadId> <qmdName> [--workspace <path>]- Link a thread to
memory/<qmdName>.mdand refresh cached context text.
- Link a thread to
Environment
DISCORD_TOKEN(required forpoll)DISCORD_GUILD_ID(default guild id forpoll)DISCORD_FORUM_CHANNEL_ID(default forum id forpoll)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_-]+forqmdName. - 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