Botlead.Bot.Adapter.Telegram (botlead v0.2.4)
Implementation business logic for Bot server for Telegram platform.
Link to this section Summary
Functions
Read module config value with default as fallback.
Read module config value, raise if not configured.
Delete existing message by it's id.
Edit existing message by it's id.
Poll all updates from Telegram server.
Start Telegram process either by webhook or with periodical config.
Create Nadia client option specification for message response.
Parse messages recieved from Telegram server.
Deliver message to Telegram with successful delivery postback.
Link to this section Types
cmd()
Specs
parsed_message()
Specs
parsed_message() :: :no_parser | :invalid_message | cmd()
Link to this section Functions
config(key, default \\ nil)
Specs
Read module config value with default as fallback.
config!(key)
Specs
Read module config value, raise if not configured.
delete_message(chat_id, message_id, client_pid, opts)
Specs
Delete existing message by it's id.
edit_message(chat_id, message_id, text, client_pid, opts)
Specs
Edit existing message by it's id.
get_updates(last_update, poll_limit)
Specs
Poll all updates from Telegram server.
init()
Specs
Start Telegram process either by webhook or with periodical config.
msg_to_opts(msg, msg_opts \\ [])
Specs
msg_to_opts( %Botlead.Message{ content: term(), inline_keyboard: term(), parse_mode: term() }, Keyword.t() ) :: Keyword.t()
Create Nadia client option specification for message response.
process_messages(messages, old_message_ids)
Specs
process_messages([map()], [integer()]) :: {:ok, [integer()], integer(), [parsed_message()]}
Parse messages recieved from Telegram server.
send_message(chat_id, text, client_pid, opts)
Specs
Deliver message to Telegram with successful delivery postback.