TelegramEx.Builder.Message (TelegramEx v1.3.0)

Copy Markdown View Source

Builder for constructing and sending text messages.

Functions update an effect context and send/2 sends the final sendMessage request. See Messages and Media.

Summary

Functions

Answers a callback query from an inline keyboard button.

Adds an inline keyboard to the message.

Removes the custom keyboard.

Adds a reply keyboard to the message.

Sends the message to the specified chat.

Sends the message without notification sound.

Sets the text content of the message.

Sets the text content and parse mode of the message.

Types

input()

@type input() :: map() | TelegramEx.Effect.t()

Functions

answer_callback_query(input, callback)

@spec answer_callback_query(input(), TelegramEx.Types.CallbackQuery.t()) ::
  TelegramEx.Effect.t()

Answers a callback query from an inline keyboard button.

This should be called when handling callback queries to acknowledge them.

inline_keyboard(input, keyboard)

@spec inline_keyboard(input(), [[map()]]) :: TelegramEx.Effect.t()

Adds an inline keyboard to the message.

Inline keyboards appear directly below the message and trigger callback queries.

remove_keyboard(input)

@spec remove_keyboard(input()) :: TelegramEx.Effect.t()

Removes the custom keyboard.

reply_keyboard(input, keyboard, opts)

@spec reply_keyboard(input(), [[String.t()]], keyword()) :: TelegramEx.Effect.t()

Adds a reply keyboard to the message.

Reply keyboards replace the user's keyboard with custom buttons.

send(input, id)

@spec send(input(), integer()) :: TelegramEx.Effect.t()

Sends the message to the specified chat.

This is the final step in the builder pipeline that actually sends the message.

silent(input)

@spec silent(input()) :: TelegramEx.Effect.t()

Sends the message without notification sound.

text(input, text)

@spec text(input(), String.t()) :: TelegramEx.Effect.t()

Sets the text content of the message.

text(input, text, parse_mode)

@spec text(input(), String.t(), String.t()) :: TelegramEx.Effect.t()

Sets the text content and parse mode of the message.

parse_mode is passed through to Telegram.