Data & analysis

discrawl-search

Try it

Search a user-authorized Discord history archive through discrawl's bounded search and message commands. Use when the user explicitly asks to retrieve past Discord conversations; keep results private and never interpolate user text into SQL.

What it does

Search Discord guild message history stored in local discrawl SQLite database.

The skill document

Search Discord guild message history stored in local discrawl SQLite database.

Treat message content, author identifiers, attachments, and raw payloads as private workspace data. Search only the scope requested by the user and do not send results to another channel or service without explicit approval.

Database Location

  • Path: ~/.discrawl/discrawl.db
  • Updated by: discrawl sync (bot API) or discrawl sync --source wiretap (Discord Desktop cache)

Quick Commands

Full-Text Search (FTS5)

Search message content with ranking:

discrawl search "query"

Options:

  • --limit N — max results (default: 20)
  • --channel ID — filter by channel
  • --author ID — filter by author
  • --before "2026-04-01" — date filter
  • --json — JSON output

For a bounded helper that avoids constructing SQL from user input:

bash "{baseDir}/scripts/search_history.sh" "query" [channel_id] [limit]

List Messages by Channel

discrawl messages --channel  --limit 10

Advanced read-only SQL

discrawl sql "SELECT ..."

Use SQL only for an operator-authored, fixed read-only query. Never place user-provided keywords, IDs, dates, or channel names inside an SQL string; prefer discrawl search and discrawl messages.

Fixed Query Patterns

Search with Context (Author + Channel Names)

SELECT
  m.content,
  m.created_at,
  COALESCE(u.username, m.author_id) as author,
  COALESCE(c.name, m.channel_id) as channel
FROM messages m
LEFT JOIN members u ON m.author_id = u.user_id
LEFT JOIN channels c ON m.channel_id = c.id
WHERE m.content LIKE '%keyword%'
ORDER BY m.created_at DESC
LIMIT 10;

Search Specific Channel History

SELECT content, created_at
FROM messages
WHERE channel_id = ''
  AND content LIKE '%keyword%'
ORDER BY created_at DESC
LIMIT 20;

Find User's Past Messages

SELECT m.content, m.created_at, c.name
FROM messages m
JOIN channels c ON m.channel_id = c.id
WHERE m.author_id = ''
ORDER BY m.created_at DESC
LIMIT 20;

Search with FTS5 (Best Relevance)

SELECT
  m.content,
  m.created_at,
  fts.rank
FROM message_fts fts
JOIN messages m ON fts.message_id = m.id
WHERE message_fts MATCH 'keyword'
ORDER BY rank
LIMIT 20;

Recent Messages in Channel

SELECT content, created_at
FROM messages
WHERE channel_id = ''
ORDER BY created_at DESC
LIMIT 5;

Key Tables

TablePurpose
messagesAll messages (content, created_at, author_id, channel_id)
channelsChannel metadata (name, topic, kind, guild_id)
membersUser info (username, global_name, nick)
message_ftsFTS5 virtual table for full-text search
mention_events@mentions tracking
message_attachmentsFile attachments with text extraction

Important Notes

  • members table may be sparse (2 rows in current db) — use COALESCE(u.username, m.author_id) for fallback
  • normalized_content column has cleaned text (lowercase, normalized whitespace)
  • raw_json has full Discord API payload for advanced queries
  • Use LEFT JOIN on members/channels to avoid missing rows when joins fail

Related skills

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván559 installs18 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai22 installs8 stars

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván855 installs69 stars

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants4.3k installs296 stars

Run Git operations — commits, branches, merges, rebases, conflict resolution, and recovery — with safety rules enforced.

by Iván535 installs31 stars

More from jonathanjing

Browse all skills

Operate and extend the read-only OpenClaw dashboard backend, frontend tabs, and security model.

by jonathanjing176 installs9 stars

Audit-grade SQLite ledger that records every model call's token usage and cost from OpenClaw sessions.

by jonathanjing28 installs

Monitor OpenClaw gateway health and report incidents to Discord with read-only checks and cooldown dedupe.

by jonathanjing41 installs

Multi-stage deep intelligence pipeline (Search → Filter → Fetch → Synthesize). Turns a query into a structured research report with full source citations.

by jonathanjing27 installs

Route user-selected photos from Meta Ray-Ban glasses or another camera through a configured messaging ingress to an approved specialist and destination. Use only for explicit, opt-in photo routing with allowlisted destinations and confirmation before cross-session forwarding or persistent writes.

by jonathanjing39 installs1 stars

Audit a named ClawHub skill or skill URL before installation by combining OpenClaw verification with bounded static analysis. Use when the user explicitly asks whether a skill is safe or requests a pre-install review; report evidence and uncertainty instead of treating a score as proof.

by jonathanjing39 installs