Packages

Elixir library for building Telegram bots with macro-based API

Current section

Files

Jump to
telegram_ex lib config.ex
Raw

lib/config.ex

defmodule TelegramEx.Config do
@moduledoc """
Reads bot configuration from the application environment.
Bot tokens are stored under the `:telegram_ex` application environment.
See [Getting Started](getting-started.md) for configuration examples.
"""
@doc """
Fetches the bot token from application configuration.
`ArgumentError` if the bot name is not configured.
"""
@spec token(atom()) :: String.t()
def token(name), do: Application.fetch_env!(:telegram_ex, name)
end