Show / Hide Table of Contents

Class KeyboardButton

This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields are mutually exclusive.

Inheritance
System.Object
KeyboardButton
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 KeyboardButton

Constructors

| Improve this Doc View Source

KeyboardButton()

Initializes a new, empty instance of the KeyboardButton class. Has to be filled with data.

Declaration
public KeyboardButton()
| Improve this Doc View Source

KeyboardButton(String)

Initializes a new instance of the KeyboardButton class

Declaration
public KeyboardButton(string text)
Parameters
Type Name Description
System.String text

The text on the button (will be sent when it is clicked)

Properties

| Improve this Doc View Source

RequestContact

Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only

Declaration
[JsonProperty(PropertyName = "request_contact")]
public bool RequestContact { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

RequestLocation

Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only

Declaration
[JsonProperty(PropertyName = "request_location")]
public bool RequestLocation { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Text

Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed

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