LemonChannels. Adapters. WhatsApp. Transport. Commands
(lemon_channels v0.1.0)
View Source
Command detection, predicate logic, and message-entry helpers for the WhatsApp transport.
All functions here are pure (no side effects, no GenServer state mutation). They inspect message text and return booleans or parsed data.
WhatsApp commands use / prefix only — no @bot suffix needed.
Summary
Functions
Returns true when the text looks like any /command message.
Extract the argument portion after /cmd.
Join a list of message entries (oldest-first) into a single text block.
Build a compact entry map from an inbound for buffering purposes.
Derive the scope key (used as buffer map key) from an inbound.
Functions
Returns true when the text looks like any /command message.
Extract the argument portion after /cmd.
Join a list of message entries (oldest-first) into a single text block.
Returns {joined_text, last_id, last_reply_to_text, last_reply_to_id}.
Build a compact entry map from an inbound for buffering purposes.
Derive the scope key (used as buffer map key) from an inbound.
Returns {peer_id, thread_id} where peer_id is the JID string.