Telegraph.API (telegraph v0.7.0) View Source

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)

View Source

Specs

build_file_url(binary()) :: binary()

Use this function to build file url.

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

Link to this function

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

View Source

Specs

request(binary(), [{atom(), any()}], atom()) ::
  :ok | {:error, Telegraph.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)

View Source