PingPong.Service.Telegram (PingPong v0.1.0)

Copy Markdown View Source

Telegram Bot API notification service.

This service sends text messages through Telegram's sendMessage endpoint. The public PingPong payload uses :content; the service maps it to Telegram's text field before sending the request.

Summary

Types

Telegram delivery options.

Telegram notification payload.

Functions

Sends a Telegram message.

Types

options()

@type options() :: %{token: binary()}

Telegram delivery options.

payload()

@type payload() :: %{content: binary(), chat_id: binary()}

Telegram notification payload.

Functions

call(payload, options)

@spec call(payload(), options()) :: PingPong.result()

Sends a Telegram message.

Required payload:

%{
  content: "Message text",
  chat_id: "123456789"
}

Required options:

%{token: "123456:telegram-bot-token"}

Missing required values return {:error, {:missing_required_params}, nil}.