You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
default:thrownewNotSupportedException("Unrecognized type of inline button");
475
+
}
476
+
}
477
+
455
478
/// <summary>Performs an implicit conversion from <see cref="string"/> to <see cref="InlineKeyboardButton"/></summary>
456
479
/// <param name="textAndCallbackDataOrUrl">Text serving as the label of the button, as well as the URL to be opened or the callback data to be sent</param>
457
480
/// <returns>The result of the conversion.</returns>
@@ -472,6 +495,18 @@ public static InlineKeyboardButton WithCallbackData(string textAndCallbackData)
472
495
473
496
publicpartialclassKeyboardButton
474
497
{
498
+
/// <summary>Generate a keyboard button from text, with one optional request</summary>
499
+
/// <param name="text">Button's text</param>
500
+
/// <param name="requestContact">Pass <see langword="true"/> to request the user's phone number, which will be sent as a contact when the button is pressed. Available in private chats only</param>
501
+
/// <param name="requestLocation">Pass <see langword="true"/> to request the user's current location, which will be sent as a location message when the button is pressed. Available in private chats only</param>
/// <summary>The enum is for use with <see cref="KeyboardButton"/> or <see cref="InlineKeyboardButton"/> constructors</summary>
4
+
publicenumInlineButtonType
5
+
{
6
+
/// <summary><c>value</c> = HTTP or tg:// URL to be opened when the button is pressed. Links <c>tg://user?id=<UserId></c> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.</summary>
7
+
Url,
8
+
/// <summary><c>value</c> = Data to be sent in a <see cref="CallbackQuery">callback query</see> to the bot when the button is pressed, 1-64 bytes</summary>
9
+
Callback,
10
+
/// <summary><c>value</c> = An HTTPS URL of the <a href="https://core.telegram.org/bots/webapps">Web App</a> that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method <see cref="TelegramBotClientExtensions.AnswerWebAppQuery">AnswerWebAppQuery</see>. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.</summary>
11
+
WebApp,
12
+
/// <summary><c>value</c> = An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the <a href="https://core.telegram.org/widgets/login">Telegram Login Widget</a>.</summary>
13
+
LoginUrl,
14
+
/// <summary>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 <c>value</c> in the input field.<br/><c>value</c> may be left empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.</summary>
15
+
SwitchInlineQuery,
16
+
/// <summary>Pressing the button will insert the bot's username and the specified inline query <c>value</c> in the current chat's input field.<br/><c>value</c> may be left empty, in which case only the bot's username will be inserted.<br/><br/>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. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account.</summary>
17
+
SwitchInlineQueryCurrentChat,
18
+
/// <summary><c>value</c> = The text to be copied to the clipboard when button is pressed; 1-256 characters</summary>
19
+
CopyText,
20
+
/// <summary>Launching a game (set in <a href="https://t.me/botfather">@BotFather</a>) when the user presses the button.<br/><br/><b>NOTE:</b> This type of button <b>must</b> always be the first button in the first row.</summary>
21
+
Game,
22
+
/// <summary><a href="https://core.telegram.org/bots/api#payments">Pay button</a>. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.<br/><br/><b>NOTE:</b> This type of button <b>must</b> always be the first button in the first row and can only be used in invoice messages.</summary>
/// <summary>Creates an inline keyboard button with description of the <a href="https://core.telegram.org/bots/webapps">Web App</a> that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method <see cref="TelegramBotClientExtensions.AnswerWebAppQuery">AnswerWebAppQuery</see>. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.</summary>
77
+
/// <param name="text">Label text on the button</param>
78
+
/// <param name="webApp">Description of the <a href="https://core.telegram.org/bots/webapps">Web App</a> that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method <see cref="TelegramBotClientExtensions.AnswerWebAppQuery">AnswerWebAppQuery</see>. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.</param>
/// <summary>Creates an inline keyboard button with description of the <a href="https://core.telegram.org/bots/webapps">Web App</a> that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method <see cref="TelegramBotClientExtensions.AnswerWebAppQuery">AnswerWebAppQuery</see>. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.</summary>
77
83
/// <param name="text">Label text on the button</param>
78
84
/// <param name="webApp">Description of the <a href="https://core.telegram.org/bots/webapps">Web App</a> that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method <see cref="TelegramBotClientExtensions.AnswerWebAppQuery">AnswerWebAppQuery</see>. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.</param>
/// <summary>Creates an inline keyboard button with an HTTPS URL used to automatically authorize the user. Can be used as a replacement for the <a href="https://core.telegram.org/widgets/login">Telegram Login Widget</a>.</summary>
89
+
/// <param name="text">Label text on the button</param>
90
+
/// <param name="loginUrl">An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the <a href="https://core.telegram.org/widgets/login">Telegram Login Widget</a>.</param>
/// <summary>Creates an inline keyboard button with an HTTPS URL used to automatically authorize the user. Can be used as a replacement for the <a href="https://core.telegram.org/widgets/login">Telegram Login Widget</a>.</summary>
83
95
/// <param name="text">Label text on the button</param>
84
96
/// <param name="loginUrl">An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the <a href="https://core.telegram.org/widgets/login">Telegram Login Widget</a>.</param>
/// <summary>Creates an inline keyboard button. Pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.</summary>
113
+
/// <param name="text">Label text on the button</param>
114
+
/// <param name="switchInlineQueryChosenChat">If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.</param>
/// <summary>Creates an inline keyboard button. Pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.</summary>
101
119
/// <param name="text">Label text on the button</param>
102
120
/// <param name="switchInlineQueryChosenChat">If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.</param>
0 commit comments