1.8 KiB
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 stdlibsslon 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.treesdefaults, so the common case needs zero config. Secrets (NickServ pass) live in gitignoredconfig.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
!delquoteshould be restricted to ops/admins (currently anyone can delete). Fine for a trusted channel; revisit if abused. - Consider registering the
treesquotesnick 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),QuoteStoreSQLite wrapper, and!command handlers. - Added
README.md,config.example.env; gitignoredquotes.db/config.env. - Syntax-checked with
py_compile(Python 3.12.3). Not yet live-tested on IRC.
External references
- Libera.Chat: https://libera.chat — server
irc.libera.chat:6697(TLS). - NickServ registration docs: https://libera.chat/guides/registration