Telegram Bot API Wrapper written in Elixir (document)
Add Nadia to your mix.exs
dependencies:
def deps do
[{:nadia, "~> 0.3"}]
end
and run $ mix deps.get
.
In config/config.exs
, add your Telegram Bot token like this
config :nadia,
token: "bot token"
You can also add an optional recv_timeout in seconds (defaults to 5s).
config :nadia,
recv_timeout: 10
And then, in mix.exs
, list :nadia
as an application inside application/0
:
def application do
[applications: [:nadia]]
end
Now Mix will guarantee the :nadia
application is started before your application is started.
iex(1)> Nadia.get_me
{:ok,
%Nadia.Model.User{first_name: "Nadia", id: 666, last_name: nil,
username: "nadia_bot"}}
Refer to Nadia document and Telegram Bot API document for more details.