Webhook management and inbound verification.
set/2/delete/0manage the bot's webhook registration.valid_secret?/2verifies theX-Telegram-Bot-Api-Secret-Tokenheader against the expected secret with a constant-time comparison.
Secret tokens are never logged: set/2 redacts them from any error text.
Summary
Functions
Bot API deleteWebhook.
Header name used for the webhook secret (X-Telegram-Bot-Api-Secret-Token).
Bot API setWebhook.
Verify the X-Telegram-Bot-Api-Secret-Token header value against the
expected secret, in constant time. Either side nil ⇒ false.
Functions
@spec delete(keyword()) :: {:ok, true} | {:error, Noizu.Telegram.Error.t()}
Bot API deleteWebhook.
@spec secret_header() :: String.t()
Header name used for the webhook secret (X-Telegram-Bot-Api-Secret-Token).
@spec set(String.t(), keyword()) :: {:ok, true} | {:error, Noizu.Telegram.Error.t()}
Bot API setWebhook.
Opts: :secret_token (header value Telegram echoes back), :allowed_updates,
:drop_pending_updates, :max_connections, :certificate.
Verify the X-Telegram-Bot-Api-Secret-Token header value against the
expected secret, in constant time. Either side nil ⇒ false.