Packages

Telegram Bot API Wrapper based on Nadia with support for multiple bots in the same application. Each bot is started under it's own supervision tree for a poller or webhook. Matchers dispatch each bot's unique module and commands in a concurrent way.

Current section

Files

Jump to
alexia lib alexia governor matcher_supervisor.ex
Raw

lib/alexia/governor/matcher_supervisor.ex

defmodule Alexia.Supervisor.Matcher do
@moduledoc """
Bot Matcher Supervisor.
"""
use Supervisor
def start_link(bots) do
Supervisor.start_link(__MODULE__,bots, name: __MODULE__)
end
def init(bots) do
# children = [ ]
children = Enum.map(bots,fn (bot) ->
Supervisor.child_spec({Alexia.Governor.Matcher, bot}, id: bot.bot_name )
end)
Supervisor.init(children, strategy: :one_for_one)
end
end