** (Mix) Could not start application my_app: MyApp.Application.start(:normal, []) returned an error: shutdown: failed to start child: Telegram.Poller
** (EXIT) bad child specification, more than one child specification has the id: Telegram.Bot.ChatBot.Chat.Supervisor.
my Application :
defmodule MyApp.Application do
use Application
alias MyApp.TelegramBot
@tg_bot_token_bot1 Application.compile_env!(:zuo_shou, :tg_bot_token_bot1)
@tg_bot_token_bot2 Application.compile_env!(:zuo_shou, :tg_bot_token_bot2)
@impl true
def start(_type, _args) do
bots = [
{TelegramBot.Bot1, bot_config(@tg_bot_token_bot1)},
{TelegramBot.Bot2, bot_config(@tg_bot_token_bot2)}
]
children = [{Telegram.Poller, bots: bots}]
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
Supervisor.start_link(children, opts)
end
@spec bot_config(String.t()) :: Keyword.t()
defp bot_config(token), do: [token: token, max_bot_concurrency: 1]
end
I've double checked and the two tokens are definitely different (IO.inspect({@tg_bot_token_bot1, @tg_bot_token_bot2})), so the issue is not the same as #153
hello, I'm back :)
I am getting the following error:
my
Application
:I've double checked and the two tokens are definitely different (
IO.inspect({@tg_bot_token_bot1, @tg_bot_token_bot2})
), so the issue is not the same as #153