Current section
Files
Jump to
Current section
Files
src/telega@internal@config.erl
-module(telega@internal@config).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([new/4]).
-export_type([config/0]).
-type config() :: {config,
binary(),
binary(),
binary(),
telega@api:telegram_api_config()}.
-spec new(binary(), binary(), binary(), gleam@option:option(binary())) -> config().
new(Token, Server_url, Webhook_path, Secret_token) ->
Secret_token@1 = gleam@option:lazy_unwrap(
Secret_token,
fun() -> _pipe = gleam@int:random(1000000),
gleam@int:to_string(_pipe) end
),
{config,
Server_url,
Webhook_path,
Secret_token@1,
{telegram_api_config, Token, 3, <<"https://api.telegram.org/bot"/utf8>>}}.