nadia v0.7.0 Nadia.API

Provides basic functionalities for Telegram Bot API.

Link to this section Summary

Link to this section Functions

Link to this function

build_file_url(file_path)
build_file_url(binary()) :: binary()

Use this function to build file url.

iex> Nadia.API.build_file_url("document/file_10") " https://api.telegram.org/file/bot #{Nadia.Config.token()}/document/file_10"

Link to this function

request(method, options \\ [], file_field \\ nil)
request(binary(), [{atom(), any()}], atom()) ::
  :ok | {:error, Nadia.Model.Error.t()} | {:ok, any()}

Generic method to call Telegram Bot API.

Args:

  • method - name of API method
  • options - orddict of options
  • file_field - specify the key of file_field in options when sending files
Link to this function

request?(method, options \\ [], file_field \\ nil)