exBotan is an Elixir wrapper for Botan.io – analytics system for your Telegram bots.
- Add exBotan to your list of dependencies in
mix.exs
:
def deps do
[{:botan, "~> 0.2.0"}]
end
Run $ mix deps.get
.
- Ensure exBotan is started before your application:
def application do
[applications: [:botan]]
end
Create Botan.io account:
- Go to Botaniobot
- Use Add bot command to get a token
You can set botan.io token as ENV variable ENV[BOTAN_TOKEN]
or store it
in config/config.exs
like this
config :botan, token: "replace_with_botan_token"
iex(1)> Botan.track("/start", 12345, chat_id: 1345)
{:ok, %{status: "accepted"}}
iex(2)> Botan.track("/help", 12345)
{:ok, %{status: "accepted"}}