botlead v0.1.6 Botlead.Bot.Adapter.Telegram
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()
parsed_message()
parsed_message() :: :no_parser | :invalid_message | cmd()
parsed_message() :: :no_parser | :invalid_message | cmd()
Link to this section Functions
config(key, default \\ nil)
Read module config value with default as fallback.
config!(key)
Read module config value, raise if not configured.
delete_message(chat_id, message_id, client_pid, opts)
Delete existing message by it's id.
edit_message(chat_id, message_id, text, client_pid, opts)
Edit existing message by it's id.
get_updates(last_update, poll_limit)
Poll all updates from Telegram server.
init()
Start Telegram process either by webhook or with periodical config.
msg_to_opts(msg, msg_opts \\ [])
Create Nadia client option specification for message response.
process_messages(messages, old_message_ids)
process_messages([map()], [integer()]) ::
{:ok, [integer()], integer(), [parsed_message()]}
process_messages([map()], [integer()]) :: {:ok, [integer()], integer(), [parsed_message()]}
Parse messages recieved from Telegram server.
send_message(chat_id, text, client_pid, opts)
Deliver message to Telegram with successful delivery postback.