summaryrefslogtreecommitdiff
path: root/lib/lsg/application.ex
diff options
context:
space:
mode:
authorhref <href@random.sh>2021-09-02 05:01:21 +0200
committerhref <href@random.sh>2021-09-02 05:01:21 +0200
commit75ef58edc8ad380792b7085ecb53d76c62efc47e (patch)
tree1c396fff5ee8ed6bf5986b8a9bb8a8da3d76a6e5 /lib/lsg/application.ex
parentnew plugin: user mention (diff)
telegram: update
Diffstat (limited to '')
-rw-r--r--lib/lsg/application.ex11
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