Telegram.Poller (telegram v2.1.0)

View Source

Telegram poller supervisor.

Usage

In you app supervisor tree:

bot_config = [
  token: Application.fetch_env!(:my_app, :token_counter_bot),
  max_bot_concurrency: Application.fetch_env!(:my_app, :max_bot_concurrency),
  allowed_updates: []   # optional (refer to Telegram.Types.bot_opts())
]

children = [
  {Telegram.Poller, bots: [{MyApp.Bot, bot_config}]}
  ...
]

opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

assert_tesla_adapter_config()

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(list)

@spec start_link([{:bots, [Telegram.Types.bot_spec()]}]) :: Supervisor.on_start()