Class InlineKeyboardButton
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
Inheritance
Inherited Members
Namespace: TelegramBotApi.Types.Markup
Assembly: TelegramBotApi.dll
Syntax
[JsonObject(MemberSerialization = MemberSerialization.OptIn, ItemNullValueHandling = NullValueHandling.Ignore)]
public class InlineKeyboardButton
Constructors
| Improve this Doc View SourceInlineKeyboardButton()
Initializes a new instance of the InlineKeyboardButton class. Has to be filled with data.
Declaration
public InlineKeyboardButton()
InlineKeyboardButton(String)
Initializes a new instance of the InlineKeyboardButton class. Has to be filled with data.
Declaration
public InlineKeyboardButton(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The text to show on the button |
Properties
| Improve this Doc View SourceCalbackGame
Optional. Description of the game that will be launched when the user presses the button.
NOTE: This type of button must always be the first button in the first row.
Declaration
[JsonProperty(PropertyName = "callback_game")]
public CallbackGame CalbackGame { get; set; }
Property Value
Type | Description |
---|---|
CallbackGame |
CallbackData
Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
Declaration
[JsonProperty(PropertyName = "callback_data")]
public string CallbackData { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Pay
Optional. Specify True, to send a Pay button.
NOTE: This type of button must always be the first button in the first row.
Declaration
[JsonProperty(PropertyName = "pay")]
public bool Pay { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SwitchInlineQuery
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.
Declaration
[JsonProperty(PropertyName = "switch_inline_query")]
public string SwitchInlineQuery { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SwitchInlineQueryCurrentChat
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.
This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options.
Declaration
[JsonProperty(PropertyName = "switch_inline_query_current_chat")]
public string SwitchInlineQueryCurrentChat { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Text
Label text on the button
Declaration
[JsonProperty(PropertyName = "text", Required = Required.Always)]
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Url
Optional. HTTP url to be opened when button is pressed
Declaration
[JsonProperty(PropertyName = "url")]
public string Url { get; set; }
Property Value
Type | Description |
---|---|
System.String |