class

CRE::Notifiers::Telegram

Inherits Reference < Object

Thin Telegram Bot API client. We hit api.telegram.org/bot<TOKEN>/<METHOD> directly with HTTP::Client; no tourmaline dependency for the notification path keeps the footprint small.

Telegram requires the bot token to live in the URL path. To prevent leaks, error messages substitute the token with '****' before surfacing any URL fragment. The token is still in the underlying request's URI; operators wiring a logging proxy in front of cre should redact at the proxy layer too.

Constants

DEFAULT_API = "https://api.telegram.org"
Log = ::Log.for("cre.telegram")

Constructors

new(token : String, api_base : String = DEFAULT_API)
Source

Instance methods

get_updates(offset : Int64 | Nil = nil, timeout : Int32 = 30) : Array(Update)
Source
send_message(chat_id : Int64, text : String, parse_mode : String | Nil = nil) : Nil
Source

Nested types