Class: InlineKeyboardButton

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(button) ⇒ InlineKeyboardButton

:nodoc:



7
8
9
# File 'lib/objects/inlinekeyboardbutton.rb', line 7

def initialize(button) # :nodoc:
  @button = button
end

Instance Method Details

#callback_dataObject

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_gameObject

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_urlObject

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 
  @button.
end

#pay?Boolean

Optional. Specify True, to send a Pay button.

Returns:

  • (Boolean)


56
57
58
# File 'lib/objects/inlinekeyboardbutton.rb', line 56

def pay?
  @button.pay
end

#switch_inline_queryObject

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_chatObject

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

#textObject

Label text on the button.



12
13
14
# File 'lib/objects/inlinekeyboardbutton.rb', line 12

def text
  @button.text
end

#urlObject

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