diff options
Diffstat (limited to 'lib/lsg/application.ex')
| -rw-r--r-- | lib/lsg/application.ex | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/lib/lsg/application.ex b/lib/lsg/application.ex index 3e5fb41..cdd7915 100644 --- a/lib/lsg/application.ex +++ b/lib/lsg/application.ex @@ -17,7 +17,6 @@ defmodule LSG.Application do        worker(LSG.Token, []),        worker(LSG.AuthToken, []),        {GenMagic.Pool, [name: LSG.GenMagic, pool_size: 2]}, -      LSG.Telegram,        #worker(LSG.Icecast, []),      ] ++ LSG.IRC.application_childs @@ -25,6 +24,7 @@ defmodule LSG.Application do      # for other strategies and supported options      opts = [strategy: :one_for_one, name: LSG.Supervisor]      sup = Supervisor.start_link(children, opts) +    start_telegram()      spawn_link(fn() -> LSG.IRC.after_start() end)      sup    end @@ -36,4 +36,13 @@ defmodule LSG.Application do      :ok    end +  defp start_telegram() do +    token = Keyword.get(Application.get_env(:lsg, :telegram, []), :key) +    options = [ +      username: Keyword.get(Application.get_env(:lsg, :telegram, []), :nick, "beauttebot"), +      purge: false +    ] +    telegram = Telegram.Bot.ChatBot.Supervisor.start_link({LSG.Telegram, token, options}) +  end +  end | 
