Agent Skillsopenclaw/openclaw › discrawl

discrawl

GitHub

Discord本地归档查询工具,支持搜索、同步新鲜度检查、DM管理及TUI界面。优先使用本地SQLite数据库,必要时调用API获取最新数据,适用于历史消息分析与统计。

.agents/skills/discrawl/SKILL.md openclaw/openclaw

Trigger Scenarios

需要查询Discord历史消息或DM记录 检查Discord数据同步状态或新鲜度 对Discord数据进行统计分析或SQL查询

Install

npx skills add openclaw/openclaw --skill discrawl -g -y
More Options

Non-standard path

npx skills add https://github.com/openclaw/openclaw/tree/main/.agents/skills/discrawl -g -y

Use without installing

npx skills use openclaw/openclaw@discrawl

指定 Agent (Claude Code)

npx skills add openclaw/openclaw --skill discrawl -a claude-code -g -y

安装 repo 全部 skill

npx skills add openclaw/openclaw --all -g -y

预览 repo 内 skill

npx skills add openclaw/openclaw --list

SKILL.md

Frontmatter
{
    "name": "discrawl",
    "metadata": {
        "openclaw": {
            "install": [
                {
                    "bins": [
                        "discrawl"
                    ],
                    "kind": "go",
                    "module": "github.com\/openclaw\/discrawl\/cmd\/discrawl@latest"
                }
            ],
            "homepage": "https:\/\/github.com\/openclaw\/discrawl",
            "requires": {
                "bins": [
                    "discrawl"
                ]
            }
        }
    },
    "description": "Discord archive: search, sync freshness, DMs, summaries, TUI, repo\/release work."
}

Discrawl

Use local Discord archive data first for Discord questions. Hit Discord APIs only when the archive is stale, missing the requested scope, or the user asks for current external context.

Sources

  • DB: platform-native XDG data dir, usually ${XDG_DATA_HOME:-~/.local/share}/discrawl/discrawl.db on Linux or ~/Library/Application Support/discrawl/discrawl.db on macOS
  • Config: platform-native XDG config dir, with legacy fallback to ~/.discrawl/config.toml
  • Cache: platform-native XDG cache dir
  • Logs: platform-native XDG state dir
  • Git share repo: platform-native XDG data dir
  • Repo: openclaw/discrawl; use ~/GIT/_Perso/discrawl only after verifying its remote targets openclaw/discrawl, otherwise use a fresh checkout
  • Preferred CLI: discrawl; fallback to go run ./cmd/discrawl from the repo if the installed binary is stale

Freshness

For recent/current questions, check freshness before analysis:

discrawl status --json

For precise freshness from the default database:

# Discrawl uses macOS ~/Library defaults unless XDG_DATA_HOME is explicitly set.
case "$(uname -s)" in
  Darwin)
    db="$HOME/Library/Application Support/discrawl/discrawl.db"
    ;;
  *)
    db="${XDG_DATA_HOME:-$HOME/.local/share}/discrawl/discrawl.db"
    ;;
esac
sqlite3 "$db" \
  "select coalesce(max(updated_at),'') from sync_state where scope like 'channel:%';"

Routine diagnostics:

discrawl doctor

Desktop-local refresh:

discrawl sync --source wiretap

Bot API latest refresh, when credentials are available:

discrawl sync

Use --full only for deliberate historical backfills:

discrawl sync --full

If SQLite reports busy/locked, check for stray discrawl processes before retrying.

Query Workflow

  1. Resolve scope: guild, channel, DM, author, keyword, date range.
  2. Check freshness for recent/current requests.
  3. Prefer CLI search/messages for slices; use read-only SQL for exact counts.
  4. Report absolute date spans, counts, channel/DM names, and known gaps.

Use root or subcommand help for syntax: discrawl --help, discrawl help search, discrawl search --help. Use DISCRAWL_NO_AUTO_UPDATE=1 for read smokes when you do not want git-share updates.

Common commands:

DISCRAWL_NO_AUTO_UPDATE=1 discrawl search --limit 20 "query"
discrawl messages --channel '#maintainers' --days 7 --all
discrawl dms --last 20
discrawl tui --dm
DISCRAWL_NO_AUTO_UPDATE=1 discrawl --json sql "select count(*) from messages;"

SQL

Use discrawl sql for exact counts, joins, and ranking queries when normal CLI reads are too coarse. The command is read-only by default, accepts SQL as args or stdin, and supports --json for agent parsing.

Useful examples:

DISCRAWL_NO_AUTO_UPDATE=1 discrawl --json sql "select count(*) as messages from messages;"
DISCRAWL_NO_AUTO_UPDATE=1 discrawl --json sql "select coalesce(nullif(c.name, ''), m.channel_id) as channel, count(*) as messages from messages m left join channels c on c.id = m.channel_id group by m.channel_id order by messages desc limit 20;"
DISCRAWL_NO_AUTO_UPDATE=1 discrawl --json sql "select coalesce(nullif(mm.display_name, ''), nullif(mm.global_name, ''), nullif(mm.username, ''), m.author_id) as author, count(*) as messages from messages m left join members mm on mm.guild_id = m.guild_id and mm.user_id = m.author_id group by m.guild_id, m.author_id order by messages desc limit 20;"

Never use --unsafe --confirm unless the user explicitly asks for a database mutation and the write has been reviewed.

When the installed CLI lacks a new feature, build or run from a verified openclaw/discrawl checkout before concluding the feature is missing.

Discord Boundaries

Bot API sync requires configured Discord bot credentials; do not invent token availability. Desktop wiretap mode reads local Discord Desktop artifacts and must not extract credentials, use user tokens, call Discord as the user, or write to Discord application storage. Wiretap/Desktop cache DMs are local-only and must not be described as part of the published Git snapshot. Git-share snapshots must not include secrets or @me DM rows.

Verification

For repo edits, prefer existing Go gates:

GOWORK=off go test ./...

Then run targeted CLI smoke for the touched surface, for example:

discrawl doctor
discrawl status --json
DISCRAWL_NO_AUTO_UPDATE=1 discrawl search --limit 5 "test"

ClawSweeper Sandbox

Use the sandbox reader only:

discrawl-sandbox search --limit 20 "query"
discrawl-sandbox messages --channel clawtributors --days 7 --all
discrawl-sandbox status --json

This reader imports https://github.com/openclaw/discord-store.git into /root/clawsweeper-sandbox-workspace/.discrawl/discrawl.db with discord.token_source = "none". The published Git snapshot is public-channel filtered; do not use /root/.discrawl/config.toml or the rich writer DB from sandboxed public Discord sessions.

Version History

  • 3374458 Current 2026-08-20 13:28

Same Skill Collection

.agents/skills/agent-transcript/SKILL.md
.agents/skills/auto-qa/SKILL.md
.agents/skills/autoreview/SKILL.md
.agents/skills/channel-message-flows/SKILL.md
.agents/skills/claw-score/SKILL.md
.agents/skills/clawdtributor/SKILL.md
.agents/skills/clawsweeper/SKILL.md
.agents/skills/control-ui-e2e/SKILL.md
.agents/skills/crabbox/SKILL.md
.agents/skills/deslop/SKILL.md
.agents/skills/discord-clawd/SKILL.md
.agents/skills/discord-user-post/SKILL.md
.agents/skills/gitcrawl/SKILL.md
.agents/skills/graincrawl/SKILL.md
.agents/skills/notcrawl/SKILL.md
.agents/skills/openclaw-changelog-update/SKILL.md
.agents/skills/openclaw-ci-limits/SKILL.md
.agents/skills/openclaw-debugging/SKILL.md
.agents/skills/openclaw-docker-e2e-authoring/SKILL.md
.agents/skills/openclaw-ghsa-maintainer/SKILL.md
.agents/skills/openclaw-live-updater/SKILL.md
.agents/skills/openclaw-parallels-smoke/SKILL.md
.agents/skills/openclaw-pr-maintainer/SKILL.md
.agents/skills/openclaw-qa-testing/SKILL.md
.agents/skills/openclaw-refactor-docs/SKILL.md
.agents/skills/openclaw-release-validation/SKILL.md
.agents/skills/openclaw-repair-sweep/SKILL.md
.agents/skills/openclaw-secret-scanning-maintainer/SKILL.md
.agents/skills/openclaw-test-heap-leaks/SKILL.md
.agents/skills/openclaw-test-performance/SKILL.md
.agents/skills/openclaw-testing/SKILL.md
.agents/skills/parallels-discord-roundtrip/SKILL.md
.agents/skills/prototype-openclaw-tui/SKILL.md
.agents/skills/release-openclaw-announcement/SKILL.md
.agents/skills/release-openclaw-ci/SKILL.md
.agents/skills/release-openclaw-mac/SKILL.md
.agents/skills/release-openclaw-maintainer/SKILL.md
.agents/skills/release-openclaw-nightly/SKILL.md
.agents/skills/release-openclaw-plugin-testing/SKILL.md
.agents/skills/security-triage/SKILL.md
.agents/skills/slacrawl/SKILL.md
.agents/skills/tag-duplicate-prs-issues/SKILL.md
.agents/skills/technical-documentation/SKILL.md
.agents/skills/telegram-crabbox-e2e-proof/SKILL.md
.agents/skills/test-audit/SKILL.md
.agents/skills/verify-release/SKILL.md
custodian-skills/add-model-provider/SKILL.md
custodian-skills/cloud-image-bake/SKILL.md
custodian-skills/configure-channel/SKILL.md

Metadata

Files
0
Version
3374458
Hash
889dc431
Indexed
2026-08-20 13:28

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-29 19:51
浙ICP备14020137号-1 $Гость$