quotebot/memory.md

1.8 KiB

memory — quotebot

Durable memory for this project. Read at session start, update before session end. Date format: YYYY-MM-DD.

Decisions & rationale

  • Python stdlib only, raw-socket IRC. User asked for a simple bot; no third-party libs means it runs anywhere with python3 bot.py, no venv/pip. TLS via stdlib ssl on Libera's port 6697.
  • SQLite for quotes (quotes.db), managed entirely with in-channel ! commands (!addquote/!quote/!delquote/!search/!quotecount). Chosen over a JSON file for safe concurrent-ish access and easy querying.
  • Config via env vars with Libera + #r.trees defaults, so the common case needs zero config. Secrets (NickServ pass) live in gitignored config.env.
  • Resilience: auto-reconnect with exponential backoff, PING/PONG, nick-in-use fallback (append _). Outbound send delay to dodge flood limits.

Open questions / TODOs

  • Live-test against Libera (join #r.trees, exercise commands). Not yet run.
  • Decide whether !delquote should be restricted to ops/admins (currently anyone can delete). Fine for a trusted channel; revisit if abused.
  • Consider registering the treesquotes nick with NickServ if the channel blocks unregistered users.

Session log

2026-06-04

  • Created project scaffold from template.
  • Wrote bot.py: stdlib IRC client (TLS, PING/PONG, reconnect, nick fallback), QuoteStore SQLite wrapper, and ! command handlers.
  • Added README.md, config.example.env; gitignored quotes.db/config.env.
  • Syntax-checked with py_compile (Python 3.12.3). Not yet live-tested on IRC.

External references