summaryrefslogtreecommitdiff
path: root/lib/lsg/lsg.ex
blob: b5da5e015430b1f67fcc57e308e5d54cf76a1226 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
defmodule LSG do

  @default_brand [
    name: "Nola,
    source_url: "https://phab.random.sh/source/Bot/",
    owner: "Ashamed owner",
    owner_email: "contact@my.nola.bot"
  ]

  def env(), do: Application.get_env(:lsg)
  def env(key, default \\ nil), do: Application.get_env(:lsg, key, default)

  def brand(), do: env(:brand, @default_brand)
  def brand(key), do: Keyword.get(brand(), key)
  def name(), do: brand(:name)
  def source_url(), do: brand(:source_url)

  def data_path(suffix) do
    Path.join(data_path(), suffix)
  end

  def data_path do
    Application.get_env(:lsg, :data_path)
  end

  def version do
    Application.spec(:lsg)[:vsn]
  end

end