LemonChannels. Adapters. Telegram. Transport. Commands
(lemon_channels v0.1.0)
View Source
Command detection, predicate logic, and message-entry helpers for the Telegram transport.
All functions here are pure (no side effects, no GenServer state mutation). They inspect message text and return booleans or parsed data.
Summary
Functions
Returns true when the text looks like a /command message.
Returns true when the text looks like a /command that is addressed to the
given bot (no @suffix, or @suffix matches bot_username).
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 / media-group map key) from an inbound.
Check whether text starts with /cmd (optionally suffixed with @BotName).
Extract the argument portion after /cmd[@BotName].
Functions
Returns true when the text looks like a /command message.
Returns true when the text looks like a /command that is addressed to the
given bot (no @suffix, or @suffix matches bot_username).
Join a list of message entries (oldest-first) into a single text block.
Returns {joined_text, last_id, last_user_msg_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 / media-group map key) from an inbound.
Check whether text starts with /cmd (optionally suffixed with @BotName).
Extract the argument portion after /cmd[@BotName].