Skip to content

Commit 1978161

Browse files
committed
Preview of Bot API 9.4 - New button styles
1 parent b9cb637 commit 1978161

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/Telegram.Bot/Types/ReplyMarkups/InlineKeyboardButton.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public partial class InlineKeyboardButton : IKeyboardButton
4646
/// <summary><em>Optional</em>. Specify <see langword="true"/>, to send a <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>
4747
public bool Pay { get; set; }
4848

49+
public KeyboardButtonStyle Style { get; set; }
50+
51+
[JsonPropertyName("icon_custom_emoji_id")]
52+
public string? IconCustomEmojiId { get; set; }
53+
4954
/// <summary>Initializes an instance of <see cref="InlineKeyboardButton"/></summary>
5055
/// <param name="text">Label text on the button</param>
5156
[SetsRequiredMembers]

src/Telegram.Bot/Types/ReplyMarkups/KeyboardButton.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// GENERATED FILE - DO NOT MODIFY MANUALLY
22
namespace Telegram.Bot.Types.ReplyMarkups;
33

4+
[JsonConverter(typeof(EnumConverter<KeyboardButtonStyle>))]
5+
public enum KeyboardButtonStyle { None = 0, Primary = 1, Danger = 2, Success = 3 }
46
/// <summary>This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, <em>String</em> can be used instead of this object to specify the button text.<br/><b>Note:</b> <see cref="RequestUsers">RequestUsers</see> and <see cref="RequestChat">RequestChat</see> options will only work in Telegram versions released after 3 February, 2023. Older clients will display <em>unsupported message</em>.</summary>
57
public partial class KeyboardButton : IKeyboardButton
68
{
@@ -32,6 +34,10 @@ public partial class KeyboardButton : IKeyboardButton
3234
[JsonPropertyName("web_app")]
3335
public WebAppInfo? WebApp { get; set; }
3436

37+
public KeyboardButtonStyle Style { get; set; }
38+
[JsonPropertyName("icon_custom_emoji_id")]
39+
public string? IconCustomEmojiId { get; set; }
40+
3541
/// <summary>Initializes an instance of <see cref="KeyboardButton"/></summary>
3642
/// <param name="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</param>
3743
[SetsRequiredMembers]

0 commit comments

Comments
 (0)