Nadia.Client (nadia v1.6.0)

View Source

Immutable Telegram Bot API client configuration.

file_mode defaults to :remote. Set it to :local only for a trusted local Bot API server that returns absolute paths accessible in Nadia's filesystem namespace.

Summary

Functions

Builds the legacy default client from application config.

Builds the legacy default client from top-level application config.

Builds a named client from config :nadia, bots: [...].

Builds a client from explicit options.

Types

api_environment()

@type api_environment() :: :production | :test

file_mode()

@type file_mode() :: :remote | :local

t()

@type t() :: %Nadia.Client{
  api_environment: api_environment(),
  base_url: binary(),
  file_base_url: binary(),
  file_mode: file_mode(),
  http_client: module(),
  proxy: term(),
  proxy_auth: term(),
  recv_timeout: non_neg_integer(),
  token: binary() | nil
}

Functions

default()

@spec default() :: t()

Builds the legacy default client from application config.

from_config()

@spec from_config() :: t()

Builds the legacy default client from top-level application config.

from_config(name)

@spec from_config(atom()) :: t()

Builds a named client from config :nadia, bots: [...].

new(opts \\ [])

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

Builds a client from explicit options.