diff options
| author | Nathan Perry <np@nathanperry.dev> | 2020-01-28 20:05:52 -0500 |
|---|---|---|
| committer | Nathan Perry <np@nathanperry.dev> | 2020-01-28 20:05:52 -0500 |
| commit | ebbe27625ba2594bd71f2b48f0f38d67ed805c02 (patch) | |
| tree | 72e53f8775fa774d8250c6bcdec27428bd07f9bb /apps/thulani_bot/lib | |
| parent | 5dadc47eb07be076a8b270458badb9d8cd7dfead (diff) | |
dotenv loading works
Diffstat (limited to 'apps/thulani_bot/lib')
| -rw-r--r-- | apps/thulani_bot/lib/thulani/bot/application.ex | 1 | ||||
| -rw-r--r-- | apps/thulani_bot/lib/thulani/bot/config.ex | 7 |
2 files changed, 3 insertions, 5 deletions
diff --git a/apps/thulani_bot/lib/thulani/bot/application.ex b/apps/thulani_bot/lib/thulani/bot/application.ex index 63bd89e..8ab6e90 100644 --- a/apps/thulani_bot/lib/thulani/bot/application.ex +++ b/apps/thulani_bot/lib/thulani/bot/application.ex @@ -4,6 +4,7 @@ defmodule Thulani.Bot.Application do def start(_type, _args) do Config.init!() + Application.start(:nostrum) children = [] diff --git a/apps/thulani_bot/lib/thulani/bot/config.ex b/apps/thulani_bot/lib/thulani/bot/config.ex index 5542752..d93e8d1 100644 --- a/apps/thulani_bot/lib/thulani/bot/config.ex +++ b/apps/thulani_bot/lib/thulani/bot/config.ex @@ -11,7 +11,7 @@ defmodule Thulani.Bot.Config do require Logger - def init!() do + def init! do load_env() |> Enum.each(fn {application, vals} -> Enum.each(vals, fn {key, val} -> Application.put_env(application, key, val) end) @@ -22,9 +22,7 @@ defmodule Thulani.Bot.Config do end end - def load_env() do - if Application.get_env(:thulani, :env) == :dev, do: load_dotenv() - + def load_env do %{ nostrum: [ token: System.fetch_env!("THULANI_TOKEN"), @@ -54,5 +52,4 @@ defmodule Thulani.Bot.Config do {env_var, value} end) end - end |
