Discrawl
Local-first Discord crawler. Pulls guild metadata, channels, and message history into ~/.discrawl/discrawl.db (SQLite) so an agent can query history without depending on Discord search.
Requirements
- Discord bot token (not a user token). Create one at https://discord.com/developers/applications.
- Bot must be invited to each guild you want to mirror, with permissions to read message history.
discrawlbinary on PATH.
Setup
export DISCORD_BOT_TOKEN="your-bot-token"
discrawl doctor # verify token + permissions
discrawl init # create local config + database
discrawl sync --full # initial sync of all accessible guilds
If you already use OpenClaw, discrawl can reuse ~/.openclaw/openclaw.json for shared config.
State
- Config:
~/.discrawl/config.toml - Database:
~/.discrawl/discrawl.db
Common Commands
discrawl status # last sync, row counts
discrawl sync --incremental # pull new messages since last run
discrawl guilds list --json
discrawl channels list --guild <id> --json
discrawl messages list --channel <id> --limit 100 --json
discrawl search "keyword" --json
discrawl sql 'SELECT count(*) FROM messages' # raw SQL
Integration Notes
- Read-only against Discord; only writes to the local SQLite file.
- Use
--jsonon every command for agent-parseable output. - Schedule incremental syncs via PaperFang cron for continuous mirroring.