Skip to content

Commit 9686653

Browse files
🤖 Merge PR DefinitelyTyped#74529 Fix node telegram bot api 9 4 types by @evgeniy-kolmak
1 parent 1d3f350 commit 9686653

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

types/node-telegram-bot-api/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,8 @@ declare namespace TelegramBot {
882882

883883
interface KeyboardButton {
884884
text: string;
885+
style?: 'primary' | 'danger' | 'success' | undefined;
886+
icon_custom_emoji_id?: string | undefined;
885887
request_user?: KeyboardButtonRequestUser | undefined;
886888
request_chat?: KeyboardButtonRequestChat | undefined;
887889
request_contact?: boolean | undefined;
@@ -922,6 +924,8 @@ declare namespace TelegramBot {
922924

923925
interface InlineKeyboardButton {
924926
text: string;
927+
style?: 'primary' | 'danger' | 'success' | undefined;
928+
icon_custom_emoji_id?: string | undefined;
925929
url?: string | undefined;
926930
callback_data?: string | undefined;
927931
web_app?: WebAppInfo;

types/node-telegram-bot-api/node-telegram-bot-api-tests.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,3 +548,32 @@ MyTelegramBot.setStickerSetThumb(1234, "my_set_thumb", "thumb_file");
548548
MyTelegramBot.setMessageReaction(1234, 1234, {
549549
reaction: [{ type: "emoji", emoji: "👍" }],
550550
});
551+
MyTelegramBot.sendMessage(1234, "test-InlineKeyboardButton", {
552+
reply_markup: {
553+
inline_keyboard: [
554+
[
555+
{
556+
text: "Registration",
557+
callback_data: "reg",
558+
icon_custom_emoji_id: "5179278706941624825",
559+
style: "primary",
560+
},
561+
],
562+
],
563+
},
564+
});
565+
MyTelegramBot.sendMessage(1234, "test-KeyboardButton", {
566+
reply_markup: {
567+
keyboard: [
568+
[
569+
{
570+
text: "Button",
571+
request_contact: false,
572+
icon_custom_emoji_id: "5179278706941624825",
573+
style: "success",
574+
},
575+
],
576+
],
577+
},
578+
});
579+

0 commit comments

Comments
 (0)