diff options
Diffstat (limited to 'lib/lsg')
-rw-r--r-- | lib/lsg/application.ex | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/lsg/application.ex b/lib/lsg/application.ex index 73ec04d..0df3c87 100644 --- a/lib/lsg/application.ex +++ b/lib/lsg/application.ex @@ -18,9 +18,7 @@ defmodule LSG.Application do worker(LSG.Icecast, []), worker(LSG.IRC.ConnectionHandler, [irc_client]), worker(LSG.IRC.LoginHandler, [irc_client]), - worker(LSG.IRC.BroadcastHandler, [irc_client]), - worker(LSG.IRC.NpHandler, [irc_client]), - ] + ] ++ irc_handlers(irc_client) # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options @@ -34,4 +32,11 @@ defmodule LSG.Application do LSGWeb.Endpoint.config_change(changed, removed) :ok end + + defp irc_handlers(irc_client) do + import Supervisor.Spec + for handler <- Application.get_env(:lsg, :irc)[:handlers] do + worker(handler, [irc_client]) + end + end end |