Hotline (Hotline v0.2.1)

Copy Markdown View Source

Telegram Bot API client and framework for Elixir.

Provides convenience functions for common Telegram Bot API methods, automatic type parsing, long-polling, webhooks, and a bot behaviour.

Quick Start

# Get bot info
{:ok, me} = Hotline.get_me(token: "your-bot-token")

# Send a message
{:ok, msg} = Hotline.send_message(%{chat_id: 123, text: "Hello!"}, token: "your-bot-token")

# Stream updates in IEx
Hotline.stream(token: "your-token") |> Enum.each(&IO.inspect/1)

Summary

Functions

Delete webhook.

Edit a message's text.

Get information about the bot.

Send a text message.

Create a lazy stream of updates.

Functions

answer_callback_query(params, opts \\ [])

Answer a callback query.

delete_message(params, opts \\ [])

Delete a message.

delete_webhook(opts \\ [])

Delete webhook.

edit_message_text(params, opts \\ [])

Edit a message's text.

get_me(opts \\ [])

Get information about the bot.

request(method, params \\ %{}, opts \\ [])

Make a raw API request.

send_document(params, opts \\ [])

Send a document.

send_message(params, opts \\ [])

Send a text message.

send_photo(params, opts \\ [])

Send a photo.

set_webhook(params, opts \\ [])

Set webhook URL.

stream(opts \\ [])

Create a lazy stream of updates.