@grammyjs/types 3.7.0 → 3.8.1
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/inline.d.ts +28 -12
- package/langs.d.ts +193 -0
- package/markup.d.ts +3 -3
- package/message.d.ts +19 -8
- package/methods.d.ts +82 -24
- package/mod.d.ts +1 -0
- package/package.json +1 -1
- package/payment.d.ts +3 -3
package/inline.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ export interface InlineQueryResultPhoto {
|
|
|
86
86
|
description?: string;
|
|
87
87
|
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
|
|
88
88
|
caption?: string;
|
|
89
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
90
|
+
show_caption_above_media?: boolean;
|
|
89
91
|
/** Mode for parsing entities in the photo caption. See formatting options for more details. */
|
|
90
92
|
parse_mode?: ParseMode;
|
|
91
93
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -117,6 +119,8 @@ export interface InlineQueryResultGif {
|
|
|
117
119
|
title?: string;
|
|
118
120
|
/** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
|
|
119
121
|
caption?: string;
|
|
122
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
123
|
+
show_caption_above_media?: boolean;
|
|
120
124
|
/** Mode for parsing entities in the caption. See formatting options for more details. */
|
|
121
125
|
parse_mode?: ParseMode;
|
|
122
126
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -148,6 +152,8 @@ export interface InlineQueryResultMpeg4Gif {
|
|
|
148
152
|
title?: string;
|
|
149
153
|
/** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
|
|
150
154
|
caption?: string;
|
|
155
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
156
|
+
show_caption_above_media?: boolean;
|
|
151
157
|
/** Mode for parsing entities in the caption. See formatting options for more details. */
|
|
152
158
|
parse_mode?: ParseMode;
|
|
153
159
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -175,6 +181,8 @@ export interface InlineQueryResultVideo {
|
|
|
175
181
|
title: string;
|
|
176
182
|
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
177
183
|
caption?: string;
|
|
184
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
185
|
+
show_caption_above_media?: boolean;
|
|
178
186
|
/** Mode for parsing entities in the video caption. See formatting options for more details. */
|
|
179
187
|
parse_mode?: ParseMode;
|
|
180
188
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -385,6 +393,8 @@ export interface InlineQueryResultCachedPhoto {
|
|
|
385
393
|
description?: string;
|
|
386
394
|
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
|
|
387
395
|
caption?: string;
|
|
396
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
397
|
+
show_caption_above_media?: boolean;
|
|
388
398
|
/** Mode for parsing entities in the photo caption. See formatting options for more details. */
|
|
389
399
|
parse_mode?: ParseMode;
|
|
390
400
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -406,6 +416,8 @@ export interface InlineQueryResultCachedGif {
|
|
|
406
416
|
title?: string;
|
|
407
417
|
/** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
|
|
408
418
|
caption?: string;
|
|
419
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
420
|
+
show_caption_above_media?: boolean;
|
|
409
421
|
/** Mode for parsing entities in the caption. See formatting options for more details. */
|
|
410
422
|
parse_mode?: ParseMode;
|
|
411
423
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -427,6 +439,8 @@ export interface InlineQueryResultCachedMpeg4Gif {
|
|
|
427
439
|
title?: string;
|
|
428
440
|
/** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
|
|
429
441
|
caption?: string;
|
|
442
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
443
|
+
show_caption_above_media?: boolean;
|
|
430
444
|
/** Mode for parsing entities in the caption. See formatting options for more details. */
|
|
431
445
|
parse_mode?: ParseMode;
|
|
432
446
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -486,6 +500,8 @@ export interface InlineQueryResultCachedVideo {
|
|
|
486
500
|
description?: string;
|
|
487
501
|
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
488
502
|
caption?: string;
|
|
503
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
504
|
+
show_caption_above_media?: boolean;
|
|
489
505
|
/** Mode for parsing entities in the video caption. See formatting options for more details. */
|
|
490
506
|
parse_mode?: ParseMode;
|
|
491
507
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -607,13 +623,13 @@ export interface InputInvoiceMessageContent {
|
|
|
607
623
|
description: string;
|
|
608
624
|
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
|
|
609
625
|
payload: string;
|
|
610
|
-
/** Payment provider token, obtained via BotFather */
|
|
611
|
-
provider_token
|
|
612
|
-
/** Three-letter ISO 4217 currency code, see more on currencies */
|
|
626
|
+
/** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
|
|
627
|
+
provider_token?: string;
|
|
628
|
+
/** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
|
|
613
629
|
currency: string;
|
|
614
|
-
/** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
|
|
630
|
+
/** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */
|
|
615
631
|
prices: LabeledPrice[];
|
|
616
|
-
/** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 */
|
|
632
|
+
/** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. */
|
|
617
633
|
max_tip_amount?: number;
|
|
618
634
|
/** An array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */
|
|
619
635
|
suggested_tip_amounts?: number[];
|
|
@@ -627,19 +643,19 @@ export interface InputInvoiceMessageContent {
|
|
|
627
643
|
photo_width?: number;
|
|
628
644
|
/** Photo height */
|
|
629
645
|
photo_height?: number;
|
|
630
|
-
/** Pass True if you require the user's full name to complete the order */
|
|
646
|
+
/** Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. */
|
|
631
647
|
need_name?: boolean;
|
|
632
|
-
/** Pass True if you require the user's phone number to complete the order */
|
|
648
|
+
/** Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. */
|
|
633
649
|
need_phone_number?: boolean;
|
|
634
|
-
/** Pass True if you require the user's email address to complete the order */
|
|
650
|
+
/** Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. */
|
|
635
651
|
need_email?: boolean;
|
|
636
|
-
/** Pass True if you require the user's shipping address to complete the order */
|
|
652
|
+
/** Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. */
|
|
637
653
|
need_shipping_address?: boolean;
|
|
638
|
-
/** Pass True if the user's phone number should be sent to provider */
|
|
654
|
+
/** Pass True if the user's phone number should be sent to provider. Ignored for payments in Telegram Stars. */
|
|
639
655
|
send_phone_number_to_provider?: boolean;
|
|
640
|
-
/** Pass True if the user's email address should be sent to provider */
|
|
656
|
+
/** Pass True if the user's email address should be sent to provider. Ignored for payments in Telegram Stars. */
|
|
641
657
|
send_email_to_provider?: boolean;
|
|
642
|
-
/** Pass True if the final price depends on the shipping method */
|
|
658
|
+
/** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
|
|
643
659
|
is_flexible?: boolean;
|
|
644
660
|
}
|
|
645
661
|
/** Represents a result of an inline query that was chosen by the user and sent to their chat partner.
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChatAdministratorRights, User } from "./manage.js";
|
|
2
2
|
import type { MaybeInaccessibleMessage } from "./message.js";
|
|
3
|
-
/** This object represents an inline keyboard
|
|
3
|
+
/** This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. */
|
|
4
4
|
export interface InlineKeyboardMarkup {
|
|
5
5
|
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
|
|
6
6
|
inline_keyboard: InlineKeyboardButton[][];
|
|
@@ -47,7 +47,7 @@ export declare namespace InlineKeyboardButton {
|
|
|
47
47
|
callback_game: CallbackGame;
|
|
48
48
|
}
|
|
49
49
|
interface PayButton extends AbstractInlineKeyboardButton {
|
|
50
|
-
/** Specify True, to send a Pay button.
|
|
50
|
+
/** Specify True, to send a Pay button. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
|
|
51
51
|
|
|
52
52
|
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
|
|
53
53
|
pay: boolean;
|
|
@@ -151,7 +151,7 @@ export declare namespace KeyboardButton {
|
|
|
151
151
|
web_app: WebAppInfo;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
/** This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text.
|
|
154
|
+
/** 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, String can be used instead of this object to specify the button text. */
|
|
155
155
|
export type KeyboardButton = KeyboardButton.CommonButton | KeyboardButton.RequestUsersButton | KeyboardButton.RequestChatButton | KeyboardButton.RequestContactButton | KeyboardButton.RequestLocationButton | KeyboardButton.RequestPollButton | KeyboardButton.WebAppButton | string;
|
|
156
156
|
/** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
|
|
157
157
|
export interface KeyboardButtonPollType {
|
package/message.d.ts
CHANGED
|
@@ -45,12 +45,16 @@ export declare namespace Message {
|
|
|
45
45
|
edit_date?: number;
|
|
46
46
|
/** True, if the message can't be forwarded */
|
|
47
47
|
has_protected_content?: true;
|
|
48
|
+
/** True, if the caption must be shown above the message media */
|
|
49
|
+
show_caption_above_media?: true;
|
|
48
50
|
/** True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message */
|
|
49
51
|
is_from_offline?: true;
|
|
50
52
|
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
|
|
51
53
|
author_signature?: string;
|
|
52
54
|
/** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
|
|
53
55
|
link_preview_options?: LinkPreviewOptions;
|
|
56
|
+
/** Unique identifier of the message effect added to the message */
|
|
57
|
+
effect_id?: string;
|
|
54
58
|
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
|
|
55
59
|
reply_markup?: InlineKeyboardMarkup;
|
|
56
60
|
}
|
|
@@ -263,7 +267,7 @@ Note that Telegram clients will display an **alert** to the user before opening
|
|
|
263
267
|
Message entities can be nested, providing following restrictions are met:
|
|
264
268
|
- If two entities have common characters, then one of them is fully contained inside another.
|
|
265
269
|
- bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
|
|
266
|
-
- blockquote entities can't be nested.
|
|
270
|
+
- blockquote and expandable_blockquote entities can't be nested.
|
|
267
271
|
- All other entities can't contain each other.
|
|
268
272
|
|
|
269
273
|
Links `tg://user?id=<user_id>` can be used to mention a user by their identifier without using a username. Please note:
|
|
@@ -295,9 +299,15 @@ pre-formatted fixed-width code block written in the Python programming language
|
|
|
295
299
|
```
|
|
296
300
|
>Block quotation started
|
|
297
301
|
>Block quotation continued
|
|
298
|
-
>
|
|
299
|
-
>
|
|
300
|
-
>The
|
|
302
|
+
>Block quotation continued
|
|
303
|
+
>Block quotation continued
|
|
304
|
+
>The last line of the block quotation
|
|
305
|
+
***>The second expandable block quotation started right after the previous
|
|
306
|
+
>It is separated from the previous block quotation by an empty bold entity
|
|
307
|
+
>Expandable block quotation continued
|
|
308
|
+
>Hidden by default part of the expandable block quotation started
|
|
309
|
+
>Expandable block quotation continued
|
|
310
|
+
>The last line of the expandable block quotation with the expandability mark||
|
|
301
311
|
```
|
|
302
312
|
Please note:
|
|
303
313
|
|
|
@@ -305,7 +315,7 @@ Please note:
|
|
|
305
315
|
- Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
|
|
306
316
|
- Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
|
|
307
317
|
- In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
|
|
308
|
-
- In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of `underline` entity, so instead of `___italic underline___` use `___italic underline_
|
|
318
|
+
- In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of an `underline` entity, so instead of `___italic underline___` use `___italic underline_**__`, adding an empty bold entity as a separator.
|
|
309
319
|
- A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
|
|
310
320
|
- Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
|
|
311
321
|
|
|
@@ -326,6 +336,7 @@ To use this mode, pass *HTML* in the *parse_mode* field. The following tags are
|
|
|
326
336
|
<pre>pre-formatted fixed-width code block</pre>
|
|
327
337
|
<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
|
|
328
338
|
<blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>
|
|
339
|
+
<blockquote expandable>Expandable block quotation started\nExpandable block quotation continued\nExpandable block quotation continued\nHidden by default part of the block quotation started\nExpandable block quotation continued\nThe last line of the block quotation</blockquote>
|
|
329
340
|
```
|
|
330
341
|
Please note:
|
|
331
342
|
|
|
@@ -357,13 +368,13 @@ pre-formatted fixed-width code block written in the Python programming language
|
|
|
357
368
|
Please note:
|
|
358
369
|
|
|
359
370
|
- Entities must not be nested, use parse mode MarkdownV2 instead.
|
|
360
|
-
- There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
|
|
371
|
+
- There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
|
|
361
372
|
- To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
|
|
362
373
|
- Escaping inside entities is not allowed, so entity must be closed first and reopened again: use `_snake_\__case_` for italic `snake_case` and `*2*\**2=4*` for bold `2*2=4`. */
|
|
363
374
|
export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
|
|
364
375
|
export declare namespace MessageEntity {
|
|
365
376
|
interface AbstractMessageEntity {
|
|
366
|
-
/** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
|
|
377
|
+
/** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
|
|
367
378
|
type: string;
|
|
368
379
|
/** Offset in UTF-16 code units to the start of the entity */
|
|
369
380
|
offset: number;
|
|
@@ -371,7 +382,7 @@ export declare namespace MessageEntity {
|
|
|
371
382
|
length: number;
|
|
372
383
|
}
|
|
373
384
|
interface CommonMessageEntity extends AbstractMessageEntity {
|
|
374
|
-
type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "code";
|
|
385
|
+
type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "expandable_blockquote" | "code";
|
|
375
386
|
}
|
|
376
387
|
interface PreMessageEntity extends AbstractMessageEntity {
|
|
377
388
|
type: "pre";
|
package/methods.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { PassportElementError } from "./passport.js";
|
|
|
7
7
|
import type { LabeledPrice, ShippingOption } 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,6 +94,8 @@ 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;
|
|
97
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
98
|
+
message_effect_id?: string;
|
|
96
99
|
/** Description of the message to reply to */
|
|
97
100
|
reply_parameters?: ReplyParameters;
|
|
98
101
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -146,6 +149,8 @@ export type ApiMethods<F> = {
|
|
|
146
149
|
parse_mode?: string;
|
|
147
150
|
/** A list of special entities that appear in the new caption, which can be specified instead of parse_mode */
|
|
148
151
|
caption_entities?: MessageEntity[];
|
|
152
|
+
/** Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. */
|
|
153
|
+
show_caption_above_media?: boolean;
|
|
149
154
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
150
155
|
disable_notification?: boolean;
|
|
151
156
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
@@ -190,12 +195,16 @@ export type ApiMethods<F> = {
|
|
|
190
195
|
parse_mode?: ParseMode;
|
|
191
196
|
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
192
197
|
caption_entities?: MessageEntity[];
|
|
198
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
199
|
+
show_caption_above_media?: boolean;
|
|
193
200
|
/** Pass True if the photo needs to be covered with a spoiler animation */
|
|
194
201
|
has_spoiler?: boolean;
|
|
195
202
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
196
203
|
disable_notification?: boolean;
|
|
197
204
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
198
205
|
protect_content?: boolean;
|
|
206
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
207
|
+
message_effect_id?: string;
|
|
199
208
|
/** Description of the message to reply to */
|
|
200
209
|
reply_parameters?: ReplyParameters;
|
|
201
210
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -233,6 +242,8 @@ export type ApiMethods<F> = {
|
|
|
233
242
|
disable_notification?: boolean;
|
|
234
243
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
235
244
|
protect_content?: boolean;
|
|
245
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
246
|
+
message_effect_id?: string;
|
|
236
247
|
/** Description of the message to reply to */
|
|
237
248
|
reply_parameters?: ReplyParameters;
|
|
238
249
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -264,6 +275,8 @@ export type ApiMethods<F> = {
|
|
|
264
275
|
disable_notification?: boolean;
|
|
265
276
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
266
277
|
protect_content?: boolean;
|
|
278
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
279
|
+
message_effect_id?: string;
|
|
267
280
|
/** Description of the message to reply to */
|
|
268
281
|
reply_parameters?: ReplyParameters;
|
|
269
282
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -295,6 +308,8 @@ export type ApiMethods<F> = {
|
|
|
295
308
|
parse_mode?: ParseMode;
|
|
296
309
|
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
297
310
|
caption_entities?: MessageEntity[];
|
|
311
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
312
|
+
show_caption_above_media?: boolean;
|
|
298
313
|
/** Pass True if the video needs to be covered with a spoiler animation */
|
|
299
314
|
has_spoiler?: boolean;
|
|
300
315
|
/** Pass True if the uploaded video is suitable for streaming */
|
|
@@ -303,6 +318,8 @@ export type ApiMethods<F> = {
|
|
|
303
318
|
disable_notification?: boolean;
|
|
304
319
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
305
320
|
protect_content?: boolean;
|
|
321
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
322
|
+
message_effect_id?: string;
|
|
306
323
|
/** Description of the message to reply to */
|
|
307
324
|
reply_parameters?: ReplyParameters;
|
|
308
325
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -334,12 +351,16 @@ export type ApiMethods<F> = {
|
|
|
334
351
|
parse_mode?: ParseMode;
|
|
335
352
|
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
336
353
|
caption_entities?: MessageEntity[];
|
|
354
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
355
|
+
show_caption_above_media?: boolean;
|
|
337
356
|
/** Pass True if the animation needs to be covered with a spoiler animation */
|
|
338
357
|
has_spoiler?: boolean;
|
|
339
358
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
340
359
|
disable_notification?: boolean;
|
|
341
360
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
342
361
|
protect_content?: boolean;
|
|
362
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
363
|
+
message_effect_id?: string;
|
|
343
364
|
/** Description of the message to reply to */
|
|
344
365
|
reply_parameters?: ReplyParameters;
|
|
345
366
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -369,6 +390,8 @@ export type ApiMethods<F> = {
|
|
|
369
390
|
disable_notification?: boolean;
|
|
370
391
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
371
392
|
protect_content?: boolean;
|
|
393
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
394
|
+
message_effect_id?: string;
|
|
372
395
|
/** Description of the message to reply to */
|
|
373
396
|
reply_parameters?: ReplyParameters;
|
|
374
397
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -397,6 +420,8 @@ export type ApiMethods<F> = {
|
|
|
397
420
|
disable_notification?: boolean;
|
|
398
421
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
399
422
|
protect_content?: boolean;
|
|
423
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
424
|
+
message_effect_id?: string;
|
|
400
425
|
/** Description of the message to reply to */
|
|
401
426
|
reply_parameters?: ReplyParameters;
|
|
402
427
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -418,6 +443,8 @@ export type ApiMethods<F> = {
|
|
|
418
443
|
disable_notification?: boolean;
|
|
419
444
|
/** Protects the contents of the sent messages from forwarding and saving */
|
|
420
445
|
protect_content?: boolean;
|
|
446
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
447
|
+
message_effect_id?: string;
|
|
421
448
|
/** Description of the message to reply to */
|
|
422
449
|
reply_parameters?: ReplyParameters;
|
|
423
450
|
/** @deprecated Use `reply_parameters` instead. */
|
|
@@ -447,6 +474,8 @@ export type ApiMethods<F> = {
|
|
|
447
474
|
disable_notification?: boolean;
|
|
448
475
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
449
476
|
protect_content?: boolean;
|
|
477
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
478
|
+
message_effect_id?: string;
|
|
450
479
|
/** Description of the message to reply to */
|
|
451
480
|
reply_parameters?: ReplyParameters;
|
|
452
481
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -516,6 +545,8 @@ export type ApiMethods<F> = {
|
|
|
516
545
|
disable_notification?: boolean;
|
|
517
546
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
518
547
|
protect_content?: boolean;
|
|
548
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
549
|
+
message_effect_id?: string;
|
|
519
550
|
/** Description of the message to reply to */
|
|
520
551
|
reply_parameters?: ReplyParameters;
|
|
521
552
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -543,6 +574,8 @@ export type ApiMethods<F> = {
|
|
|
543
574
|
disable_notification?: boolean;
|
|
544
575
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
545
576
|
protect_content?: boolean;
|
|
577
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
578
|
+
message_effect_id?: string;
|
|
546
579
|
/** Description of the message to reply to */
|
|
547
580
|
reply_parameters?: ReplyParameters;
|
|
548
581
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -590,6 +623,8 @@ export type ApiMethods<F> = {
|
|
|
590
623
|
disable_notification?: boolean;
|
|
591
624
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
592
625
|
protect_content?: boolean;
|
|
626
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
627
|
+
message_effect_id?: string;
|
|
593
628
|
/** Description of the message to reply to */
|
|
594
629
|
reply_parameters?: ReplyParameters;
|
|
595
630
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -611,6 +646,8 @@ export type ApiMethods<F> = {
|
|
|
611
646
|
disable_notification?: boolean;
|
|
612
647
|
/** Protects the contents of the sent message from forwarding */
|
|
613
648
|
protect_content?: boolean;
|
|
649
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
650
|
+
message_effect_id?: string;
|
|
614
651
|
/** Description of the message to reply to */
|
|
615
652
|
reply_parameters?: ReplyParameters;
|
|
616
653
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -1023,64 +1060,64 @@ export type ApiMethods<F> = {
|
|
|
1023
1060
|
/** Unique identifier of the business connection */
|
|
1024
1061
|
business_connection_id: string;
|
|
1025
1062
|
}): BusinessConnection;
|
|
1026
|
-
/** Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success. */
|
|
1063
|
+
/** Use this method to change the list of the bot's commands. See https://core.telegram.org/bots/features#commands for more details about bot commands. Returns True on success. */
|
|
1027
1064
|
setMyCommands(args: {
|
|
1028
1065
|
/** A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
|
|
1029
1066
|
commands: readonly BotCommand[];
|
|
1030
1067
|
/** An object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
|
|
1031
1068
|
scope?: BotCommandScope;
|
|
1032
1069
|
/** 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 */
|
|
1033
|
-
language_code?:
|
|
1070
|
+
language_code?: LanguageCode;
|
|
1034
1071
|
}): true;
|
|
1035
1072
|
/** 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. */
|
|
1036
1073
|
deleteMyCommands(args: {
|
|
1037
1074
|
/** An object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
|
|
1038
1075
|
scope?: BotCommandScope;
|
|
1039
1076
|
/** 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 */
|
|
1040
|
-
language_code?:
|
|
1077
|
+
language_code?: LanguageCode;
|
|
1041
1078
|
}): true;
|
|
1042
1079
|
/** 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. */
|
|
1043
1080
|
getMyCommands(args: {
|
|
1044
1081
|
/** An object, describing scope of users. Defaults to BotCommandScopeDefault. */
|
|
1045
1082
|
scope?: BotCommandScope;
|
|
1046
1083
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1047
|
-
language_code?:
|
|
1084
|
+
language_code?: LanguageCode;
|
|
1048
1085
|
}): BotCommand[];
|
|
1049
1086
|
/** Use this method to change the bot's name. Returns True on success. */
|
|
1050
1087
|
setMyName(args: {
|
|
1051
1088
|
/** New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. */
|
|
1052
1089
|
name?: string;
|
|
1053
1090
|
/** 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. */
|
|
1054
|
-
language_code?:
|
|
1091
|
+
language_code?: LanguageCode;
|
|
1055
1092
|
}): true;
|
|
1056
1093
|
/** Use this method to get the current bot name for the given user language. Returns BotName on success. */
|
|
1057
1094
|
getMyName(args: {
|
|
1058
1095
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1059
|
-
language_code?:
|
|
1096
|
+
language_code?: LanguageCode;
|
|
1060
1097
|
}): BotName;
|
|
1061
1098
|
/** 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. */
|
|
1062
1099
|
setMyDescription(args: {
|
|
1063
1100
|
/** New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. */
|
|
1064
1101
|
description?: string;
|
|
1065
1102
|
/** 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. */
|
|
1066
|
-
language_code?:
|
|
1103
|
+
language_code?: LanguageCode;
|
|
1067
1104
|
}): true;
|
|
1068
1105
|
/** Use this method to get the current bot description for the given user language. Returns BotDescription on success. */
|
|
1069
1106
|
getMyDescription(args: {
|
|
1070
1107
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1071
|
-
language_code?:
|
|
1108
|
+
language_code?: LanguageCode;
|
|
1072
1109
|
}): BotDescription;
|
|
1073
1110
|
/** 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. */
|
|
1074
1111
|
setMyShortDescription(args: {
|
|
1075
1112
|
/** New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. */
|
|
1076
1113
|
short_description?: string;
|
|
1077
1114
|
/** 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. */
|
|
1078
|
-
language_code?:
|
|
1115
|
+
language_code?: LanguageCode;
|
|
1079
1116
|
}): true;
|
|
1080
1117
|
/** Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success. */
|
|
1081
1118
|
getMyShortDescription(args: {
|
|
1082
1119
|
/** A two-letter ISO 639-1 language code or an empty string */
|
|
1083
|
-
language_code?:
|
|
1120
|
+
language_code?: LanguageCode;
|
|
1084
1121
|
}): BotShortDescription;
|
|
1085
1122
|
/** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. */
|
|
1086
1123
|
setChatMenuButton(args: {
|
|
@@ -1139,6 +1176,8 @@ export type ApiMethods<F> = {
|
|
|
1139
1176
|
parse_mode?: ParseMode;
|
|
1140
1177
|
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1141
1178
|
caption_entities?: MessageEntity[];
|
|
1179
|
+
/** Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages. */
|
|
1180
|
+
show_caption_above_media?: boolean;
|
|
1142
1181
|
/** An object for an inline keyboard. */
|
|
1143
1182
|
reply_markup?: InlineKeyboardMarkup;
|
|
1144
1183
|
}): (Update.Edited & Message.CaptionableMessage) | true;
|
|
@@ -1214,6 +1253,8 @@ export type ApiMethods<F> = {
|
|
|
1214
1253
|
disable_notification?: boolean;
|
|
1215
1254
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1216
1255
|
protect_content?: boolean;
|
|
1256
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
1257
|
+
message_effect_id?: string;
|
|
1217
1258
|
/** Description of the message to reply to */
|
|
1218
1259
|
reply_parameters?: ReplyParameters;
|
|
1219
1260
|
/** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. */
|
|
@@ -1375,13 +1416,13 @@ export type ApiMethods<F> = {
|
|
|
1375
1416
|
description: string;
|
|
1376
1417
|
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
|
|
1377
1418
|
payload: string;
|
|
1378
|
-
/** Payment provider token, obtained via
|
|
1379
|
-
provider_token
|
|
1380
|
-
/** Three-letter ISO 4217 currency code, see more on currencies */
|
|
1419
|
+
/** Payment provider token, obtained via BotFather. Pass an empty string for payments in Telegram Stars. */
|
|
1420
|
+
provider_token?: string;
|
|
1421
|
+
/** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
|
|
1381
1422
|
currency: string;
|
|
1382
|
-
/** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
|
|
1423
|
+
/** Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */
|
|
1383
1424
|
prices: readonly LabeledPrice[];
|
|
1384
|
-
/** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 */
|
|
1425
|
+
/** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars. */
|
|
1385
1426
|
max_tip_amount?: number;
|
|
1386
1427
|
/** An array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */
|
|
1387
1428
|
suggested_tip_amounts?: number[];
|
|
@@ -1397,24 +1438,26 @@ export type ApiMethods<F> = {
|
|
|
1397
1438
|
photo_width?: number;
|
|
1398
1439
|
/** Photo height */
|
|
1399
1440
|
photo_height?: number;
|
|
1400
|
-
/** Pass True if you require the user's full name to complete the order */
|
|
1441
|
+
/** Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. */
|
|
1401
1442
|
need_name?: boolean;
|
|
1402
|
-
/** Pass True if you require the user's phone number to complete the order */
|
|
1443
|
+
/** Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. */
|
|
1403
1444
|
need_phone_number?: boolean;
|
|
1404
|
-
/** Pass True if you require the user's email address to complete the order */
|
|
1445
|
+
/** Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. */
|
|
1405
1446
|
need_email?: boolean;
|
|
1406
|
-
/** Pass True if you require the user's shipping address to complete the order */
|
|
1447
|
+
/** Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. */
|
|
1407
1448
|
need_shipping_address?: boolean;
|
|
1408
|
-
/** Pass True if the user's phone number should be sent to provider */
|
|
1449
|
+
/** Pass True if the user's phone number should be sent to provider. Ignored for payments in Telegram Stars. */
|
|
1409
1450
|
send_phone_number_to_provider?: boolean;
|
|
1410
|
-
/** Pass True if the user's email address should be sent to provider */
|
|
1451
|
+
/** Pass True if the user's email address should be sent to provider. Ignored for payments in Telegram Stars. */
|
|
1411
1452
|
send_email_to_provider?: boolean;
|
|
1412
|
-
/** Pass True if the final price depends on the shipping method */
|
|
1453
|
+
/** Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */
|
|
1413
1454
|
is_flexible?: boolean;
|
|
1414
1455
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
1415
1456
|
disable_notification?: boolean;
|
|
1416
1457
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1417
1458
|
protect_content?: boolean;
|
|
1459
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
1460
|
+
message_effect_id?: string;
|
|
1418
1461
|
/** Description of the message to reply to */
|
|
1419
1462
|
reply_parameters?: ReplyParameters;
|
|
1420
1463
|
/** An object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. */
|
|
@@ -1430,8 +1473,8 @@ export type ApiMethods<F> = {
|
|
|
1430
1473
|
description: string;
|
|
1431
1474
|
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
|
|
1432
1475
|
payload: string;
|
|
1433
|
-
/** Payment provider token, obtained via BotFather */
|
|
1434
|
-
provider_token
|
|
1476
|
+
/** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
|
|
1477
|
+
provider_token?: string;
|
|
1435
1478
|
/** Three-letter ISO 4217 currency code, see more on currencies */
|
|
1436
1479
|
currency: string;
|
|
1437
1480
|
/** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
|
|
@@ -1485,6 +1528,13 @@ export type ApiMethods<F> = {
|
|
|
1485
1528
|
/** 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. */
|
|
1486
1529
|
error_message?: string;
|
|
1487
1530
|
}): true;
|
|
1531
|
+
/** Refunds a successful payment in Telegram Stars. Returns True on success. */
|
|
1532
|
+
refundStarPayment(args: {
|
|
1533
|
+
/** Identifier of the user whose payment will be refunded */
|
|
1534
|
+
user_id: number;
|
|
1535
|
+
/** Telegram payment identifier */
|
|
1536
|
+
telegram_payment_charge_id: string;
|
|
1537
|
+
}): true;
|
|
1488
1538
|
/** Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
|
|
1489
1539
|
|
|
1490
1540
|
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. */
|
|
@@ -1508,6 +1558,8 @@ export type ApiMethods<F> = {
|
|
|
1508
1558
|
disable_notification?: boolean;
|
|
1509
1559
|
/** Protects the contents of the sent message from forwarding and saving */
|
|
1510
1560
|
protect_content?: boolean;
|
|
1561
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
1562
|
+
message_effect_id?: string;
|
|
1511
1563
|
/** Description of the message to reply to */
|
|
1512
1564
|
reply_parameters?: ReplyParameters;
|
|
1513
1565
|
/** An object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. */
|
|
@@ -1574,6 +1626,8 @@ export interface InputMediaPhoto<F> {
|
|
|
1574
1626
|
media: F | string;
|
|
1575
1627
|
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
|
|
1576
1628
|
caption?: string;
|
|
1629
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
1630
|
+
show_caption_above_media?: boolean;
|
|
1577
1631
|
/** Mode for parsing entities in the photo caption. See formatting options for more details. */
|
|
1578
1632
|
parse_mode?: ParseMode;
|
|
1579
1633
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -1591,6 +1645,8 @@ export interface InputMediaVideo<F> {
|
|
|
1591
1645
|
thumbnail?: F;
|
|
1592
1646
|
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
1593
1647
|
caption?: string;
|
|
1648
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
1649
|
+
show_caption_above_media?: boolean;
|
|
1594
1650
|
/** Mode for parsing entities in the video caption. See formatting options for more details. */
|
|
1595
1651
|
parse_mode?: ParseMode;
|
|
1596
1652
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
@@ -1616,6 +1672,8 @@ export interface InputMediaAnimation<F> {
|
|
|
1616
1672
|
thumbnail?: F;
|
|
1617
1673
|
/** Caption of the animation to be sent, 0-1024 characters after entities parsing */
|
|
1618
1674
|
caption?: string;
|
|
1675
|
+
/** Pass True, if the caption must be shown above the message media */
|
|
1676
|
+
show_caption_above_media?: boolean;
|
|
1619
1677
|
/** Mode for parsing entities in the animation caption. See formatting options for more details. */
|
|
1620
1678
|
parse_mode?: ParseMode;
|
|
1621
1679
|
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
|
package/mod.d.ts
CHANGED
package/package.json
CHANGED
package/payment.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface Invoice {
|
|
|
14
14
|
description: string;
|
|
15
15
|
/** Unique bot deep-linking parameter that can be used to generate this invoice */
|
|
16
16
|
start_parameter: string;
|
|
17
|
-
/** Three-letter ISO 4217 currency code */
|
|
17
|
+
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
|
|
18
18
|
currency: string;
|
|
19
19
|
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
20
20
|
total_amount: number;
|
|
@@ -56,7 +56,7 @@ export interface ShippingOption {
|
|
|
56
56
|
}
|
|
57
57
|
/** This object contains basic information about a successful payment. */
|
|
58
58
|
export interface SuccessfulPayment {
|
|
59
|
-
/** Three-letter ISO 4217 currency code */
|
|
59
|
+
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
|
|
60
60
|
currency: string;
|
|
61
61
|
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
62
62
|
total_amount: number;
|
|
@@ -88,7 +88,7 @@ export interface PreCheckoutQuery {
|
|
|
88
88
|
id: string;
|
|
89
89
|
/** User who sent the query */
|
|
90
90
|
from: User;
|
|
91
|
-
/** Three-letter ISO 4217 currency code */
|
|
91
|
+
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
|
|
92
92
|
currency: string;
|
|
93
93
|
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
94
94
|
total_amount: number;
|