Class: InlineKeyboardButton
- Inherits:
-
Object
- Object
- InlineKeyboardButton
- Defined in:
- lib/objects/inlinekeyboardbutton.rb
Overview
This object represents one button of an inline keyboard.
You must use exactly one of the optional fields.
Instance Method Summary collapse
-
#callback_data ⇒ Object
Optional
. -
#callback_game ⇒ Object
Optional
. -
#initialize(button) ⇒ InlineKeyboardButton
constructor
:nodoc:.
-
#login_url ⇒ Object
Optional
. -
#pay? ⇒ Boolean
Optional
. -
#switch_inline_query ⇒ Object
Optional
. -
#switch_inline_query_current_chat ⇒ Object
Optional.
If set, pressing the button will insert the bot’s username and the specified inline query in the current chat’s input field. -
#text ⇒ Object
Label text on the button.
-
#url ⇒ Object
Optional
.
Constructor Details
#initialize(button) ⇒ InlineKeyboardButton
:nodoc:
7 8 9 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 7 def initialize() # :nodoc: @button = end |
Instance Method Details
#callback_data ⇒ Object
Optional
. Data to be sent in a CallbackQuery to the bot when button is pressed, 1-64 bytes.
30 31 32 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 30 def callback_data @button.callback_data end |
#callback_game ⇒ Object
Optional
. Description of the game that will be launched when the user presses the button.
51 52 53 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 51 def callback_game @button.callback_game end |
#login_url ⇒ Object
Optional
. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
24 25 26 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 24 def login_url @button.login_url end |
#pay? ⇒ Boolean
Optional
. Specify True, to send a Pay button.
56 57 58 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 56 def pay? @button.pay end |
#switch_inline_query ⇒ Object
Optional
. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot’s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
38 39 40 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 38 def switch_inline_query @button.switch_inline_query end |
#switch_inline_query_current_chat ⇒ Object
Optional.
If set, pressing the button will insert the bot’s username and the specified inline query in the current chat’s input field. Can be empty, in which case only the bot’s username will be inserted.
45 46 47 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 45 def switch_inline_query_current_chat @button.switch_inline_query_current_chat end |
#text ⇒ Object
Label text on the button.
12 13 14 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 12 def text @button.text end |
#url ⇒ Object
Optional
. HTTP or tg:// url to be opened when button is pressed
17 18 19 |
# File 'lib/objects/inlinekeyboardbutton.rb', line 17 def url @button.url end |