Show / Hide Table of Contents

Class InlineKeyboardButton

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

Inheritance
System.Object
InlineKeyboardButton
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TelegramBotApi.Types.Markup
Assembly: TelegramBotApi.dll
Syntax
[JsonObject(MemberSerialization = MemberSerialization.OptIn, ItemNullValueHandling = NullValueHandling.Ignore)]
public class InlineKeyboardButton

Constructors

| Improve this Doc View Source

InlineKeyboardButton()

Initializes a new instance of the InlineKeyboardButton class. Has to be filled with data.

Declaration
public InlineKeyboardButton()
| Improve this Doc View Source

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 Source

CalbackGame

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

Text

Label text on the button

Declaration
[JsonProperty(PropertyName = "text", Required = Required.Always)]
public string Text { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

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
  • Improve this Doc
  • View Source
Back to top Generated by DocFX