plugins/gateways/telegram/sender
Telegram message sender. Sends messages via telega with MarkdownV2 formatting and plain-text fallback.
Types
pub type SendResult {
Sent
ParseErrorSentPlain(text: String)
SendFailed(reason: String)
}
Constructors
-
Sent -
ParseErrorSentPlain(text: String) -
SendFailed(reason: String)
Values
pub fn log_send(chat_id: String, text: String) -> Nil
Log that a message would be sent (for CLI development).
pub fn send(ctx: bot.Context(a, b), text: String) -> SendResult
Send a MarkdownV2-formatted reply using the telega Context. Falls back to plain text if MarkdownV2 parsing fails.
The Context type is telega’s bot.Context — it carries the chat_id, bot client, and session data needed for sending messages.
pub fn send_typing(ctx: bot.Context(a, b)) -> Nil
Send a typing indicator via the Telegram sendChatAction API. Should be called before a potentially long-running operation (e.g., LLM call) so the user sees the “…” typing animation while waiting.