BotexTelegram.Helpers.Buttons (botex_telegram v2.0.1)
Buttons creating helper
Summary
Functions
create button object
create button object
Create button with no caption and no action in it
Create telegram menu buttons from list BotEx.Models.Button
create set of buttons, which already fits one entire row
create set of buttons, which already fits one entire row
a set of buttons, fits entire single row, with only a "back" button inside
a set of buttons, fits entire single row, with only a "back" button inside
create pagination button set
Functions
create button object
Parameters
- action: command routing action
- caption: button caption
@spec create_button(binary(), binary(), binary(), binary()) :: %{ callback_data: binary(), text: binary() }
create button object
Parameters
- module: command routing module
- action: command routing action
- data: command routing data
- caption: button caption
Create button with no caption and no action in it
Parameters
- caption: button caption
@spec create_from_model([[BotEx.Models.Button.t()]]) :: %Telegex.Type.InlineKeyboardMarkup{ inline_keyboard: [[Telegex.Type.InlineKeyboardButton.t()]] }
Create telegram menu buttons from list BotEx.Models.Button
Parameters
- buttons: list of
[[BotEx.Models.Button]]
@spec create_single_row_button(binary(), binary()) :: [ [%{callback_data: binary(), text: binary()}] ]
create set of buttons, which already fits one entire row
@spec create_single_row_button(binary(), binary(), binary(), binary()) :: [ [%{callback_data: binary(), text: binary()}] ]
create set of buttons, which already fits one entire row
Parameters
- module: command routing module
- action: command routing action
- data: command routing data
- caption: button caption
a set of buttons, fits entire single row, with only a "back" button inside
Parameters
- action: back action
a set of buttons, fits entire single row, with only a "back" button inside
Parameters
- action: back action
- caption: button caption
@spec get_pagination( binary(), binary(), %{total_pages: integer(), page_size: integer(), page_number: integer()}, binary(), binary(), binary(), binary(), binary() ) :: [[%{text: binary(), callback_data: binary()}]]
create pagination button set
Parameters
- module: command routing module
- action: command routing action
- page: scrivener_ecto pagination object
- data: command additional data
- next_symbol: next page symbol
- prev_symbol: prev page symbol
- last_symbol: last page symbol
- first_symbol: first page symbol