Skip to content

Commit 18649b0

Browse files
authored
🤖 Merge PR DefinitelyTyped#71970 [@types/node-telegram-bot-api] fix: Add missing method createInvoiceLink in types. by @shubham88fru
1 parent 7afc361 commit 18649b0

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,21 @@ declare namespace TelegramBot {
304304
is_flexible?: boolean | undefined;
305305
}
306306

307+
interface CreateInvoiceLinkOptions {
308+
provider_data?: string | undefined;
309+
photo_url?: string | undefined;
310+
photo_size?: number | undefined;
311+
photo_width?: number | undefined;
312+
photo_height?: number | undefined;
313+
need_name?: boolean | undefined;
314+
need_phone_number?: boolean | undefined;
315+
need_email?: boolean | undefined;
316+
need_shipping_address?: boolean | undefined;
317+
send_phone_number_to_provider?: boolean | undefined;
318+
send_email_to_provider?: boolean | undefined;
319+
is_flexible?: boolean | undefined;
320+
}
321+
307322
interface CopyMessageOptions extends SendBasicOptions {
308323
caption?: string | undefined;
309324
parse_mode?: ParseMode | undefined;
@@ -1976,6 +1991,16 @@ declare class TelegramBot extends TelegramBotEventEmitter<TelegramBot.TelegramEv
19761991
options?: TelegramBot.SendInvoiceOptions,
19771992
): Promise<TelegramBot.Message>;
19781993

1994+
createInvoiceLink(
1995+
title: string,
1996+
description: string,
1997+
payload: string,
1998+
providerToken: string,
1999+
currency: string,
2000+
prices: readonly TelegramBot.LabeledPrice[],
2001+
options?: TelegramBot.CreateInvoiceLinkOptions,
2002+
): Promise<string>;
2003+
19792004
answerShippingQuery(
19802005
shippingQueryId: string,
19812006
ok: boolean,

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,20 @@ MyTelegramBot.sendInvoice(
319319
],
320320
{ is_flexible: true, start_parameter: "start_parameter" },
321321
);
322+
MyTelegramBot.createInvoiceLink(
323+
"Invoice Title",
324+
"Invoice Description",
325+
"Invoice Payload",
326+
"Providertoken",
327+
"Currency",
328+
[
329+
{
330+
label: "$",
331+
amount: 1200,
332+
},
333+
],
334+
{ photo_url: "url", need_email: false, send_phone_number_to_provider: false, is_flexible: true },
335+
);
322336
MyTelegramBot.answerShippingQuery("shippingQueryId", true, {
323337
shipping_options: [
324338
{

0 commit comments

Comments
 (0)