defmodule LSG.IRC do
def application_childs do
{:ok, irc_client} = ExIRC.start_link!
import Supervisor.Spec
[
worker(Registry, [[keys: :duplicate, name: IRC.PubSub]], id: :registry_irc),
worker(IRC.UserTrack.Storage, []),
worker(IRC.ConnectionHandler, [irc_client]),
worker(IRC.LoginHandler, [irc_client]),
worker(IRC.UserTrackHandler, [irc_client]),
worker(IRC.PubSubHandler, [irc_client], [name: :irc_pub_sub]),
]
++
for handler <- Application.get_env(:lsg, :irc)[:handlers] do
worker(handler, [irc_client], [name: handler])
end
++
for plugin <- Application.get_env(:lsg, :irc)[:plugins] do
worker(plugin, [], [name: plugin])
end
end
end