Noizu.Telegram.Client (Noizu Telegram v0.1.0)

Copy Markdown View Source

Bot API client configuration: token + base URL.

Precedence for new/1 (later wins): app env :noizu_telegram, :client defaults, then opts, then TELEGRAM_BOT_TOKEN.

The token is part of the Bot API URL path, so Inspect redacts it and redact/2 scrubs it from error text.

Summary

Functions

Client from call opts: opts[:client] wins; otherwise new/1 on the remaining opts (token override, env, app env).

Redact the client's token wherever it appears in text.

Types

t()

@type t() :: %Noizu.Telegram.Client{
  base_url: String.t(),
  req_options: keyword(),
  retry: keyword(),
  token: String.t() | nil,
  user_agent: String.t() | nil
}

Functions

from_opts(opts)

@spec from_opts(keyword()) :: t()

Client from call opts: opts[:client] wins; otherwise new/1 on the remaining opts (token override, env, app env).

new(opts)

@spec new(keyword()) :: t()

redact(arg1, text)

@spec redact(t() | nil, String.t()) :: String.t()

Redact the client's token wherever it appears in text.