@grammyjs/types 3.8.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/langs.d.ts +193 -0
- package/markup.d.ts +1 -1
- package/methods.d.ts +53 -31
- package/mod.d.ts +1 -0
- package/package.json +1 -1
- package/payment.d.ts +68 -0
package/langs.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/** A two-letter ISO 639-1 language code.
|
|
2
|
+
* @see https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
|
|
3
|
+
* @see https://www.loc.gov/standards/iso639-2/php/code_list.php
|
|
4
|
+
*/
|
|
5
|
+
export type LanguageCode = typeof LanguageCodes[keyof typeof LanguageCodes];
|
|
6
|
+
/**
|
|
7
|
+
* @see {@link LanguageCode}
|
|
8
|
+
*/
|
|
9
|
+
export declare const LanguageCodes: {
|
|
10
|
+
readonly Abkhazian: "ab";
|
|
11
|
+
readonly Afar: "aa";
|
|
12
|
+
readonly Afrikaans: "af";
|
|
13
|
+
readonly Akan: "ak";
|
|
14
|
+
readonly Albanian: "sq";
|
|
15
|
+
readonly Amharic: "am";
|
|
16
|
+
readonly Arabic: "ar";
|
|
17
|
+
readonly Aragonese: "an";
|
|
18
|
+
readonly Armenian: "hy";
|
|
19
|
+
readonly Assamese: "as";
|
|
20
|
+
readonly Avaric: "av";
|
|
21
|
+
readonly Avestan: "ae";
|
|
22
|
+
readonly Aymara: "ay";
|
|
23
|
+
readonly Azerbaijani: "az";
|
|
24
|
+
readonly Bambara: "bm";
|
|
25
|
+
readonly Bashkir: "ba";
|
|
26
|
+
readonly Basque: "eu";
|
|
27
|
+
readonly Belarusian: "be";
|
|
28
|
+
readonly Bengali: "bn";
|
|
29
|
+
readonly Bislama: "bi";
|
|
30
|
+
readonly Bosnian: "bs";
|
|
31
|
+
readonly Breton: "br";
|
|
32
|
+
readonly Bulgarian: "bg";
|
|
33
|
+
readonly Burmese: "my";
|
|
34
|
+
readonly Catalan: "ca";
|
|
35
|
+
readonly Chamorro: "ch";
|
|
36
|
+
readonly Chechen: "ce";
|
|
37
|
+
readonly Chichewa: "ny";
|
|
38
|
+
readonly Chinese: "zh";
|
|
39
|
+
readonly ChurchSlavonic: "cu";
|
|
40
|
+
readonly Chuvash: "cv";
|
|
41
|
+
readonly Cornish: "kw";
|
|
42
|
+
readonly Corsican: "co";
|
|
43
|
+
readonly Cree: "cr";
|
|
44
|
+
readonly Croatian: "hr";
|
|
45
|
+
readonly Czech: "cs";
|
|
46
|
+
readonly Danish: "da";
|
|
47
|
+
readonly Divehi: "dv";
|
|
48
|
+
readonly Dutch: "nl";
|
|
49
|
+
readonly Dzongkha: "dz";
|
|
50
|
+
readonly English: "en";
|
|
51
|
+
readonly Esperanto: "eo";
|
|
52
|
+
readonly Estonian: "et";
|
|
53
|
+
readonly Ewe: "ee";
|
|
54
|
+
readonly Faroese: "fo";
|
|
55
|
+
readonly Fijian: "fj";
|
|
56
|
+
readonly Finnish: "fi";
|
|
57
|
+
readonly French: "fr";
|
|
58
|
+
readonly WesternFrisian: "fy";
|
|
59
|
+
readonly Fulah: "ff";
|
|
60
|
+
readonly Gaelic: "gd";
|
|
61
|
+
readonly Galician: "gl";
|
|
62
|
+
readonly Ganda: "lg";
|
|
63
|
+
readonly Georgian: "ka";
|
|
64
|
+
readonly German: "de";
|
|
65
|
+
readonly Greek: "el";
|
|
66
|
+
readonly Kalaallisut: "kl";
|
|
67
|
+
readonly Guarani: "gn";
|
|
68
|
+
readonly Gujarati: "gu";
|
|
69
|
+
readonly Haitian: "ht";
|
|
70
|
+
readonly Hausa: "ha";
|
|
71
|
+
readonly Hebrew: "he";
|
|
72
|
+
readonly Herero: "hz";
|
|
73
|
+
readonly Hindi: "hi";
|
|
74
|
+
readonly HiriMotu: "ho";
|
|
75
|
+
readonly Hungarian: "hu";
|
|
76
|
+
readonly Icelandic: "is";
|
|
77
|
+
readonly Ido: "io";
|
|
78
|
+
readonly Igbo: "ig";
|
|
79
|
+
readonly Indonesian: "id";
|
|
80
|
+
readonly Interlingua: "ia";
|
|
81
|
+
readonly Interlingue: "ie";
|
|
82
|
+
readonly Inuktitut: "iu";
|
|
83
|
+
readonly Inupiaq: "ik";
|
|
84
|
+
readonly Irish: "ga";
|
|
85
|
+
readonly Italian: "it";
|
|
86
|
+
readonly Japanese: "ja";
|
|
87
|
+
readonly Javanese: "jv";
|
|
88
|
+
readonly Kannada: "kn";
|
|
89
|
+
readonly Kanuri: "kr";
|
|
90
|
+
readonly Kashmiri: "ks";
|
|
91
|
+
readonly Kazakh: "kk";
|
|
92
|
+
readonly CentralKhmer: "km";
|
|
93
|
+
readonly Kikuyu: "ki";
|
|
94
|
+
readonly Kinyarwanda: "rw";
|
|
95
|
+
readonly Kirghiz: "ky";
|
|
96
|
+
readonly Komi: "kv";
|
|
97
|
+
readonly Kongo: "kg";
|
|
98
|
+
readonly Korean: "ko";
|
|
99
|
+
readonly Kuanyama: "kj";
|
|
100
|
+
readonly Kurdish: "ku";
|
|
101
|
+
readonly Lao: "lo";
|
|
102
|
+
readonly Latin: "la";
|
|
103
|
+
readonly Latvian: "lv";
|
|
104
|
+
readonly Limburgan: "li";
|
|
105
|
+
readonly Lingala: "ln";
|
|
106
|
+
readonly Lithuanian: "lt";
|
|
107
|
+
readonly LubaKatanga: "lu";
|
|
108
|
+
readonly Luxembourgish: "lb";
|
|
109
|
+
readonly Macedonian: "mk";
|
|
110
|
+
readonly Malagasy: "mg";
|
|
111
|
+
readonly Malay: "ms";
|
|
112
|
+
readonly Malayalam: "ml";
|
|
113
|
+
readonly Maltese: "mt";
|
|
114
|
+
readonly Manx: "gv";
|
|
115
|
+
readonly Maori: "mi";
|
|
116
|
+
readonly Marathi: "mr";
|
|
117
|
+
readonly Marshallese: "mh";
|
|
118
|
+
readonly Mongolian: "mn";
|
|
119
|
+
readonly Nauru: "na";
|
|
120
|
+
readonly Navajo: "nv";
|
|
121
|
+
readonly NorthNdebele: "nd";
|
|
122
|
+
readonly SouthNdebele: "nr";
|
|
123
|
+
readonly Ndonga: "ng";
|
|
124
|
+
readonly Nepali: "ne";
|
|
125
|
+
readonly Norwegian: "no";
|
|
126
|
+
readonly NorwegianBokmål: "nb";
|
|
127
|
+
readonly NorwegianNynorsk: "nn";
|
|
128
|
+
readonly SichuanYi: "ii";
|
|
129
|
+
readonly Occitan: "oc";
|
|
130
|
+
readonly Ojibwa: "oj";
|
|
131
|
+
readonly Oriya: "or";
|
|
132
|
+
readonly Oromo: "om";
|
|
133
|
+
readonly Ossetian: "os";
|
|
134
|
+
readonly Pali: "pi";
|
|
135
|
+
readonly Pashto: "ps";
|
|
136
|
+
readonly Persian: "fa";
|
|
137
|
+
readonly Polish: "pl";
|
|
138
|
+
readonly Portuguese: "pt";
|
|
139
|
+
readonly Punjabi: "pa";
|
|
140
|
+
readonly Quechua: "qu";
|
|
141
|
+
readonly Romanian: "ro";
|
|
142
|
+
readonly Romansh: "rm";
|
|
143
|
+
readonly Rundi: "rn";
|
|
144
|
+
readonly Russian: "ru";
|
|
145
|
+
readonly NorthernSami: "se";
|
|
146
|
+
readonly Samoan: "sm";
|
|
147
|
+
readonly Sango: "sg";
|
|
148
|
+
readonly Sanskrit: "sa";
|
|
149
|
+
readonly Sardinian: "sc";
|
|
150
|
+
readonly Serbian: "sr";
|
|
151
|
+
readonly Shona: "sn";
|
|
152
|
+
readonly Sindhi: "sd";
|
|
153
|
+
readonly Sinhala: "si";
|
|
154
|
+
readonly Slovak: "sk";
|
|
155
|
+
readonly Slovenian: "sl";
|
|
156
|
+
readonly Somali: "so";
|
|
157
|
+
readonly SouthernSotho: "st";
|
|
158
|
+
readonly Spanish: "es";
|
|
159
|
+
readonly Sundanese: "su";
|
|
160
|
+
readonly Swahili: "sw";
|
|
161
|
+
readonly Swati: "ss";
|
|
162
|
+
readonly Swedish: "sv";
|
|
163
|
+
readonly Tagalog: "tl";
|
|
164
|
+
readonly Tahitian: "ty";
|
|
165
|
+
readonly Tajik: "tg";
|
|
166
|
+
readonly Tamil: "ta";
|
|
167
|
+
readonly Tatar: "tt";
|
|
168
|
+
readonly Telugu: "te";
|
|
169
|
+
readonly Thai: "th";
|
|
170
|
+
readonly Tibetan: "bo";
|
|
171
|
+
readonly Tigrinya: "ti";
|
|
172
|
+
readonly Tonga: "to";
|
|
173
|
+
readonly Tsonga: "ts";
|
|
174
|
+
readonly Tswana: "tn";
|
|
175
|
+
readonly Turkish: "tr";
|
|
176
|
+
readonly Turkmen: "tk";
|
|
177
|
+
readonly Twi: "tw";
|
|
178
|
+
readonly Uighur: "ug";
|
|
179
|
+
readonly Ukrainian: "uk";
|
|
180
|
+
readonly Urdu: "ur";
|
|
181
|
+
readonly Uzbek: "uz";
|
|
182
|
+
readonly Venda: "ve";
|
|
183
|
+
readonly Vietnamese: "vi";
|
|
184
|
+
readonly Volapük: "vo";
|
|
185
|
+
readonly Walloon: "wa";
|
|
186
|
+
readonly Welsh: "cy";
|
|
187
|
+
readonly Wolof: "wo";
|
|
188
|
+
readonly Xhosa: "xh";
|
|
189
|
+
readonly Yiddish: "yi";
|
|
190
|
+
readonly Yoruba: "yo";
|
|
191
|
+
readonly Zhuang: "za";
|
|
192
|
+
readonly Zulu: "zu";
|
|
193
|
+
};
|
package/markup.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare namespace InlineKeyboardButton {
|
|
|
15
15
|
url: string;
|
|
16
16
|
}
|
|
17
17
|
interface CallbackButton extends AbstractInlineKeyboardButton {
|
|
18
|
-
/** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
|
|
18
|
+
/** Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes */
|
|
19
19
|
callback_data: string;
|
|
20
20
|
}
|
|
21
21
|
interface WebAppButton extends AbstractInlineKeyboardButton {
|
package/methods.d.ts
CHANGED
|
@@ -4,9 +4,10 @@ import type { ChatFullInfo } from "./manage.js";
|
|
|
4
4
|
import type { ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "./markup.js";
|
|
5
5
|
import type { File, GameHighScore, InputPollOption, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet } from "./message.js";
|
|
6
6
|
import type { PassportElementError } from "./passport.js";
|
|
7
|
-
import type { LabeledPrice, ShippingOption } from "./payment.js";
|
|
7
|
+
import type { LabeledPrice, ShippingOption, StarTransactions } from "./payment.js";
|
|
8
8
|
import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
|
|
9
9
|
import type { Update } from "./update.js";
|
|
10
|
+
import type { LanguageCode } from "./langs.js";
|
|
10
11
|
/** Extracts the parameters of a given method name */
|
|
11
12
|
type Params<F, M extends keyof ApiMethods<F>> = Parameters<ApiMethods<F>[M]>;
|
|
12
13
|
/** Utility type providing the argument type for the given method name or `{}` if the method does not take any parameters */
|
|
@@ -93,7 +94,7 @@ export type ApiMethods<F> = {
|
|
|
93
94
|
disable_notification?: boolean;
|
|
94
95
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
95
96
|
protect_content?: boolean;
|
|
96
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
97
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
97
98
|
message_effect_id?: string;
|
|
98
99
|
/** Description of the message to reply to */
|
|
99
100
|
reply_parameters?: ReplyParameters;
|
|
@@ -202,7 +203,7 @@ export type ApiMethods<F> = {
|
|
|
202
203
|
disable_notification?: boolean;
|
|
203
204
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
204
205
|
protect_content?: boolean;
|
|
205
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
206
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
206
207
|
message_effect_id?: string;
|
|
207
208
|
/** Description of the message to reply to */
|
|
208
209
|
reply_parameters?: ReplyParameters;
|
|
@@ -241,7 +242,7 @@ export type ApiMethods<F> = {
|
|
|
241
242
|
disable_notification?: boolean;
|
|
242
243
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
243
244
|
protect_content?: boolean;
|
|
244
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
245
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
245
246
|
message_effect_id?: string;
|
|
246
247
|
/** Description of the message to reply to */
|
|
247
248
|
reply_parameters?: ReplyParameters;
|
|
@@ -274,7 +275,7 @@ export type ApiMethods<F> = {
|
|
|
274
275
|
disable_notification?: boolean;
|
|
275
276
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
276
277
|
protect_content?: boolean;
|
|
277
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
278
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
278
279
|
message_effect_id?: string;
|
|
279
280
|
/** Description of the message to reply to */
|
|
280
281
|
reply_parameters?: ReplyParameters;
|
|
@@ -317,7 +318,7 @@ export type ApiMethods<F> = {
|
|
|
317
318
|
disable_notification?: boolean;
|
|
318
319
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
319
320
|
protect_content?: boolean;
|
|
320
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
321
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
321
322
|
message_effect_id?: string;
|
|
322
323
|
/** Description of the message to reply to */
|
|
323
324
|
reply_parameters?: ReplyParameters;
|
|
@@ -358,7 +359,7 @@ export type ApiMethods<F> = {
|
|
|
358
359
|
disable_notification?: boolean;
|
|
359
360
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
360
361
|
protect_content?: boolean;
|
|
361
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
362
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
362
363
|
message_effect_id?: string;
|
|
363
364
|
/** Description of the message to reply to */
|
|
364
365
|
reply_parameters?: ReplyParameters;
|
|
@@ -389,7 +390,7 @@ export type ApiMethods<F> = {
|
|
|
389
390
|
disable_notification?: boolean;
|
|
390
391
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
391
392
|
protect_content?: boolean;
|
|
392
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
393
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
393
394
|
message_effect_id?: string;
|
|
394
395
|
/** Description of the message to reply to */
|
|
395
396
|
reply_parameters?: ReplyParameters;
|
|
@@ -419,7 +420,7 @@ export type ApiMethods<F> = {
|
|
|
419
420
|
disable_notification?: boolean;
|
|
420
421
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
421
422
|
protect_content?: boolean;
|
|
422
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
423
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
423
424
|
message_effect_id?: string;
|
|
424
425
|
/** Description of the message to reply to */
|
|
425
426
|
reply_parameters?: ReplyParameters;
|
|
@@ -442,7 +443,7 @@ export type ApiMethods<F> = {
|
|
|
442
443
|
disable_notification?: boolean;
|
|
443
444
|
/** Protects the contents of the sent messages from forwarding and saving */
|
|
444
445
|
protect_content?: boolean;
|
|
445
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
446
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
446
447
|
message_effect_id?: string;
|
|
447
448
|
/** Description of the message to reply to */
|
|
448
449
|
reply_parameters?: ReplyParameters;
|
|
@@ -473,7 +474,7 @@ export type ApiMethods<F> = {
|
|
|
473
474
|
disable_notification?: boolean;
|
|
474
475
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
475
476
|
protect_content?: boolean;
|
|
476
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
477
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
477
478
|
message_effect_id?: string;
|
|
478
479
|
/** Description of the message to reply to */
|
|
479
480
|
reply_parameters?: ReplyParameters;
|
|
@@ -484,6 +485,8 @@ export type ApiMethods<F> = {
|
|
|
484
485
|
}): Message.LocationMessage;
|
|
485
486
|
/** Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
486
487
|
editMessageLiveLocation(args: {
|
|
488
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
489
|
+
business_connection_id?: string;
|
|
487
490
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
488
491
|
chat_id?: number | string;
|
|
489
492
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -507,6 +510,8 @@ export type ApiMethods<F> = {
|
|
|
507
510
|
}): (Update.Edited & Message.LocationMessage) | true;
|
|
508
511
|
/** Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
509
512
|
stopMessageLiveLocation(args: {
|
|
513
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
514
|
+
business_connection_id?: string;
|
|
510
515
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
511
516
|
chat_id?: number | string;
|
|
512
517
|
/** Required if inline_message_id is not specified. Identifier of the message with live location to stop */
|
|
@@ -544,7 +549,7 @@ export type ApiMethods<F> = {
|
|
|
544
549
|
disable_notification?: boolean;
|
|
545
550
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
546
551
|
protect_content?: boolean;
|
|
547
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
552
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
548
553
|
message_effect_id?: string;
|
|
549
554
|
/** Description of the message to reply to */
|
|
550
555
|
reply_parameters?: ReplyParameters;
|
|
@@ -573,7 +578,7 @@ export type ApiMethods<F> = {
|
|
|
573
578
|
disable_notification?: boolean;
|
|
574
579
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
575
580
|
protect_content?: boolean;
|
|
576
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
581
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
577
582
|
message_effect_id?: string;
|
|
578
583
|
/** Description of the message to reply to */
|
|
579
584
|
reply_parameters?: ReplyParameters;
|
|
@@ -622,7 +627,7 @@ export type ApiMethods<F> = {
|
|
|
622
627
|
disable_notification?: boolean;
|
|
623
628
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
624
629
|
protect_content?: boolean;
|
|
625
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
630
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
626
631
|
message_effect_id?: string;
|
|
627
632
|
/** Description of the message to reply to */
|
|
628
633
|
reply_parameters?: ReplyParameters;
|
|
@@ -645,7 +650,7 @@ export type ApiMethods<F> = {
|
|
|
645
650
|
disable_notification?: boolean;
|
|
646
651
|
/** Protects the contents of the sent message from forwarding */
|
|
647
652
|
protect_content?: boolean;
|
|
648
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
653
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
649
654
|
message_effect_id?: string;
|
|
650
655
|
/** Description of the message to reply to */
|
|
651
656
|
reply_parameters?: ReplyParameters;
|
|
@@ -1066,57 +1071,57 @@ export type ApiMethods<F> = {
|
|
|
1066
1071
|
/** An object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
|
|
1067
1072
|
scope?: BotCommandScope;
|
|
1068
1073
|
/** A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands */
|
|
1069
|
-
language_code?:
|
|
1074
|
+
language_code?: LanguageCode;
|
|
1070
1075
|
}): true;
|
|
1071
1076
|
/** Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success. */
|
|
1072
1077
|
deleteMyCommands(args: {
|
|
1073
1078
|
/** An object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
|
|
1074
1079
|
scope?: BotCommandScope;
|
|
1075
1080
|
/** A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands */
|
|
1076
|
-
language_code?:
|
|
1081
|
+
language_code?: LanguageCode;
|
|
1077
1082
|
}): true;
|
|
1078
1083
|
/** Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned. */
|
|
1079
1084
|
getMyCommands(args: {
|
|
1080
1085
|
/** An object, describing scope of users. Defaults to BotCommandScopeDefault. */
|
|
1081
1086
|
scope?: BotCommandScope;
|
|
1082
1087
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1083
|
-
language_code?:
|
|
1088
|
+
language_code?: LanguageCode;
|
|
1084
1089
|
}): BotCommand[];
|
|
1085
1090
|
/** Use this method to change the bot's name. Returns True on success. */
|
|
1086
1091
|
setMyName(args: {
|
|
1087
1092
|
/** New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. */
|
|
1088
1093
|
name?: string;
|
|
1089
1094
|
/** A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. */
|
|
1090
|
-
language_code?:
|
|
1095
|
+
language_code?: LanguageCode;
|
|
1091
1096
|
}): true;
|
|
1092
1097
|
/** Use this method to get the current bot name for the given user language. Returns BotName on success. */
|
|
1093
1098
|
getMyName(args: {
|
|
1094
1099
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1095
|
-
language_code?:
|
|
1100
|
+
language_code?: LanguageCode;
|
|
1096
1101
|
}): BotName;
|
|
1097
1102
|
/** Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success. */
|
|
1098
1103
|
setMyDescription(args: {
|
|
1099
1104
|
/** New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. */
|
|
1100
1105
|
description?: string;
|
|
1101
1106
|
/** A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description. */
|
|
1102
|
-
language_code?:
|
|
1107
|
+
language_code?: LanguageCode;
|
|
1103
1108
|
}): true;
|
|
1104
1109
|
/** Use this method to get the current bot description for the given user language. Returns BotDescription on success. */
|
|
1105
1110
|
getMyDescription(args: {
|
|
1106
1111
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1107
|
-
language_code?:
|
|
1112
|
+
language_code?: LanguageCode;
|
|
1108
1113
|
}): BotDescription;
|
|
1109
1114
|
/** Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success. */
|
|
1110
1115
|
setMyShortDescription(args: {
|
|
1111
1116
|
/** New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. */
|
|
1112
1117
|
short_description?: string;
|
|
1113
1118
|
/** A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description. */
|
|
1114
|
-
language_code?:
|
|
1119
|
+
language_code?: LanguageCode;
|
|
1115
1120
|
}): true;
|
|
1116
1121
|
/** Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success. */
|
|
1117
1122
|
getMyShortDescription(args: {
|
|
1118
1123
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1119
|
-
language_code?:
|
|
1124
|
+
language_code?: LanguageCode;
|
|
1120
1125
|
}): BotShortDescription;
|
|
1121
1126
|
/** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. */
|
|
1122
1127
|
setChatMenuButton(args: {
|
|
@@ -1142,8 +1147,10 @@ export type ApiMethods<F> = {
|
|
|
1142
1147
|
/** Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. */
|
|
1143
1148
|
for_channels?: boolean;
|
|
1144
1149
|
}): ChatAdministratorRights;
|
|
1145
|
-
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1150
|
+
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1146
1151
|
editMessageText(args: {
|
|
1152
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1153
|
+
business_connection_id?: string;
|
|
1147
1154
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1148
1155
|
chat_id?: number | string;
|
|
1149
1156
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1161,8 +1168,10 @@ export type ApiMethods<F> = {
|
|
|
1161
1168
|
/** An object for an inline keyboard. */
|
|
1162
1169
|
reply_markup?: InlineKeyboardMarkup;
|
|
1163
1170
|
}): (Update.Edited & Message.TextMessage) | true;
|
|
1164
|
-
/** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1171
|
+
/** Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1165
1172
|
editMessageCaption(args: {
|
|
1173
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1174
|
+
business_connection_id?: string;
|
|
1166
1175
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1167
1176
|
chat_id?: number | string;
|
|
1168
1177
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1180,8 +1189,10 @@ export type ApiMethods<F> = {
|
|
|
1180
1189
|
/** An object for an inline keyboard. */
|
|
1181
1190
|
reply_markup?: InlineKeyboardMarkup;
|
|
1182
1191
|
}): (Update.Edited & Message.CaptionableMessage) | true;
|
|
1183
|
-
/** Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1192
|
+
/** Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1184
1193
|
editMessageMedia(args: {
|
|
1194
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1195
|
+
business_connection_id?: string;
|
|
1185
1196
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1186
1197
|
chat_id?: number | string;
|
|
1187
1198
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1193,8 +1204,10 @@ export type ApiMethods<F> = {
|
|
|
1193
1204
|
/** An object for a new inline keyboard. */
|
|
1194
1205
|
reply_markup?: InlineKeyboardMarkup;
|
|
1195
1206
|
}): (Update.Edited & Message) | true;
|
|
1196
|
-
/** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
1207
|
+
/** Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1197
1208
|
editMessageReplyMarkup(args: {
|
|
1209
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1210
|
+
business_connection_id?: string;
|
|
1198
1211
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1199
1212
|
chat_id?: number | string;
|
|
1200
1213
|
/** Required if inline_message_id is not specified. Identifier of the message to edit */
|
|
@@ -1206,6 +1219,8 @@ export type ApiMethods<F> = {
|
|
|
1206
1219
|
}): (Update.Edited & Message) | true;
|
|
1207
1220
|
/** Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned. */
|
|
1208
1221
|
stopPoll(args: {
|
|
1222
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
1223
|
+
business_connection_id?: string;
|
|
1209
1224
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1210
1225
|
chat_id: number | string;
|
|
1211
1226
|
/** Identifier of the original message with the poll */
|
|
@@ -1252,7 +1267,7 @@ export type ApiMethods<F> = {
|
|
|
1252
1267
|
disable_notification?: boolean;
|
|
1253
1268
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1254
1269
|
protect_content?: boolean;
|
|
1255
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1270
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1256
1271
|
message_effect_id?: string;
|
|
1257
1272
|
/** Description of the message to reply to */
|
|
1258
1273
|
reply_parameters?: ReplyParameters;
|
|
@@ -1455,7 +1470,7 @@ export type ApiMethods<F> = {
|
|
|
1455
1470
|
disable_notification?: boolean;
|
|
1456
1471
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1457
1472
|
protect_content?: boolean;
|
|
1458
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1473
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1459
1474
|
message_effect_id?: string;
|
|
1460
1475
|
/** Description of the message to reply to */
|
|
1461
1476
|
reply_parameters?: ReplyParameters;
|
|
@@ -1527,6 +1542,13 @@ export type ApiMethods<F> = {
|
|
|
1527
1542
|
/** Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. */
|
|
1528
1543
|
error_message?: string;
|
|
1529
1544
|
}): true;
|
|
1545
|
+
/** Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object. */
|
|
1546
|
+
getStarTransactions(args: {
|
|
1547
|
+
/** Number of transactions to skip in the response */
|
|
1548
|
+
offset?: number;
|
|
1549
|
+
/** The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
|
|
1550
|
+
limit?: number;
|
|
1551
|
+
}): StarTransactions;
|
|
1530
1552
|
/** Refunds a successful payment in Telegram Stars. Returns True on success. */
|
|
1531
1553
|
refundStarPayment(args: {
|
|
1532
1554
|
/** Identifier of the user whose payment will be refunded */
|
|
@@ -1557,7 +1579,7 @@ export type ApiMethods<F> = {
|
|
|
1557
1579
|
disable_notification?: boolean;
|
|
1558
1580
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1559
1581
|
protect_content?: boolean;
|
|
1560
|
-
/** Unique identifier of the message effect to be added to the message */
|
|
1582
|
+
/** Unique identifier of the message effect to be added to the message; for private chats only */
|
|
1561
1583
|
message_effect_id?: string;
|
|
1562
1584
|
/** Description of the message to reply to */
|
|
1563
1585
|
reply_parameters?: ReplyParameters;
|
package/mod.d.ts
CHANGED
package/package.json
CHANGED
package/payment.d.ts
CHANGED
|
@@ -99,3 +99,71 @@ export interface PreCheckoutQuery {
|
|
|
99
99
|
/** Order information provided by the user */
|
|
100
100
|
order_info?: OrderInfo;
|
|
101
101
|
}
|
|
102
|
+
/** This object describes the state of a revenue withdrawal operation. Currently, it can be one of
|
|
103
|
+
|
|
104
|
+
- RevenueWithdrawalStatePending
|
|
105
|
+
- RevenueWithdrawalStateSucceeded
|
|
106
|
+
- RevenueWithdrawalStateFailed */
|
|
107
|
+
export type RevenueWithdrawalState = RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed;
|
|
108
|
+
/** The withdrawal is in progress. */
|
|
109
|
+
export interface RevenueWithdrawalStatePending {
|
|
110
|
+
/** Type of the state, always “pending” */
|
|
111
|
+
type: "pending";
|
|
112
|
+
}
|
|
113
|
+
/** The withdrawal succeeded. */
|
|
114
|
+
export interface RevenueWithdrawalStateSucceeded {
|
|
115
|
+
/** Type of the state, always “succeeded” */
|
|
116
|
+
type: "succeeded";
|
|
117
|
+
/** Date the withdrawal was completed in Unix time */
|
|
118
|
+
date: number;
|
|
119
|
+
/** An HTTPS URL that can be used to see transaction details */
|
|
120
|
+
url: string;
|
|
121
|
+
}
|
|
122
|
+
/** The withdrawal failed and the transaction was refunded. */
|
|
123
|
+
export interface RevenueWithdrawalStateFailed {
|
|
124
|
+
/** Type of the state, always “failed” */
|
|
125
|
+
type: "failed";
|
|
126
|
+
}
|
|
127
|
+
/** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
|
|
128
|
+
|
|
129
|
+
- TransactionPartnerFragment
|
|
130
|
+
- TransactionPartnerUser
|
|
131
|
+
- TransactionPartnerOther */
|
|
132
|
+
export type TransactionPartner = TransactionPartnerFragment | TransactionPartnerUser | TransactionPartnerOther;
|
|
133
|
+
/** Describes a withdrawal transaction with Fragment. */
|
|
134
|
+
export interface TransactionPartnerFragment {
|
|
135
|
+
/** Type of the transaction partner, always “fragment” */
|
|
136
|
+
type: "fragment";
|
|
137
|
+
/** State of the transaction if the transaction is outgoing */
|
|
138
|
+
withdrawal_state?: RevenueWithdrawalState;
|
|
139
|
+
}
|
|
140
|
+
/** Describes a transaction with a user. */
|
|
141
|
+
export interface TransactionPartnerUser {
|
|
142
|
+
/** Type of the transaction partner, always “user” */
|
|
143
|
+
type: "user";
|
|
144
|
+
/** Information about the user */
|
|
145
|
+
user: User;
|
|
146
|
+
}
|
|
147
|
+
/** Describes a transaction with an unknown source or recipient. */
|
|
148
|
+
export interface TransactionPartnerOther {
|
|
149
|
+
/** Type of the transaction partner, always “other” */
|
|
150
|
+
type: "other";
|
|
151
|
+
}
|
|
152
|
+
/** Describes a Telegram Star transaction. */
|
|
153
|
+
export interface StarTransaction {
|
|
154
|
+
/** Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. */
|
|
155
|
+
id: string;
|
|
156
|
+
/** Number of Telegram Stars transferred by the transaction */
|
|
157
|
+
amount: number;
|
|
158
|
+
/** Date the transaction was created in Unix time */
|
|
159
|
+
date: number;
|
|
160
|
+
/** Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions */
|
|
161
|
+
source?: TransactionPartner;
|
|
162
|
+
/** Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions */
|
|
163
|
+
receiver?: TransactionPartner;
|
|
164
|
+
}
|
|
165
|
+
/** Contains a list of Telegram Star transactions. */
|
|
166
|
+
export interface StarTransactions {
|
|
167
|
+
/** The list of transactions */
|
|
168
|
+
transactions: StarTransaction[];
|
|
169
|
+
}
|