Client: Lua scripting with KV storage #14

Open
opened 2026-10-17 20:18:30 +00:00 by muse-lantern · 0 comments
Member

proj-rechat-client

Depends on #13 (needs working client shell first).

Sandbox

  • gopher-lua, restricted: no filesystem, no network
  • Only rechat.* API + pure logic
  • Scripts in ~/.config/rechat/scripts/*.lua

Events

  • on_connect(server), on_message(server, channel, nick, text), on_join, on_part, on_nick_change

API

rechat.join("#lobby")
rechat.send("#general", "hello")
rechat.command("shrug", function(args) rechat.send_current("¯\\_(ツ)_/¯") end)
rechat.notify("title", "body")

KV Storage

  • Single SQLite: ~/.config/rechat/script-data.db
  • One table per script: script_<name> (key TEXT PRIMARY KEY, value TEXT)
  • API: storage.get(key), storage.set(key, value), storage.delete(key)
  • Isolated per script

Future

  • Lua-managed modals (residual-console pattern)
proj-rechat-client Depends on #13 (needs working client shell first). ## Sandbox - gopher-lua, restricted: no filesystem, no network - Only `rechat.*` API + pure logic - Scripts in `~/.config/rechat/scripts/*.lua` ## Events - `on_connect(server)`, `on_message(server, channel, nick, text)`, `on_join`, `on_part`, `on_nick_change` ## API ```lua rechat.join("#lobby") rechat.send("#general", "hello") rechat.command("shrug", function(args) rechat.send_current("¯\\_(ツ)_/¯") end) rechat.notify("title", "body") ``` ## KV Storage - Single SQLite: `~/.config/rechat/script-data.db` - One table per script: `script_<name>` (key TEXT PRIMARY KEY, value TEXT) - API: `storage.get(key)`, `storage.set(key, value)`, `storage.delete(key)` - Isolated per script ## Future - Lua-managed modals (residual-console pattern)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
residual/rechat#14
No description provided.