@telegram.ts/types 1.19.1 → 1.21.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/package.json +1 -1
- package/src/apiMethodsTypes.d.ts +59 -11
- package/src/inlineTypes.d.ts +2 -4
- package/src/invoiceTypes.d.ts +14 -1
- package/src/messageTypes.d.ts +5 -1
package/package.json
CHANGED
package/src/apiMethodsTypes.d.ts
CHANGED
|
@@ -77,11 +77,11 @@ export type ApiMethods = {
|
|
|
77
77
|
timeout?: number;
|
|
78
78
|
/** A list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
|
|
79
79
|
|
|
80
|
-
Please note that this parameter doesn't affect updates created before the call to
|
|
80
|
+
Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time. */
|
|
81
81
|
allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
|
|
82
82
|
}): Update[];
|
|
83
83
|
|
|
84
|
-
/** Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.
|
|
84
|
+
/** Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.
|
|
85
85
|
|
|
86
86
|
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
|
|
87
87
|
|
|
@@ -170,6 +170,8 @@ export type ApiMethods = {
|
|
|
170
170
|
message_thread_id?: number;
|
|
171
171
|
/** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
|
|
172
172
|
from_chat_id: number | string;
|
|
173
|
+
/** New start timestamp for the copied video in the message */
|
|
174
|
+
video_start_timestamp?: number;
|
|
173
175
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
174
176
|
disable_notification?: boolean;
|
|
175
177
|
/** Protects the contents of the forwarded message from forwarding and saving */
|
|
@@ -202,6 +204,8 @@ export type ApiMethods = {
|
|
|
202
204
|
message_thread_id?: number;
|
|
203
205
|
/** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
|
|
204
206
|
from_chat_id: number | string;
|
|
207
|
+
/** New start timestamp for the copied video in the message */
|
|
208
|
+
video_start_timestamp?: number;
|
|
205
209
|
/** Message identifier in the chat specified in from_chat_id */
|
|
206
210
|
message_id: number;
|
|
207
211
|
/** New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept */
|
|
@@ -384,6 +388,10 @@ export type ApiMethods = {
|
|
|
384
388
|
height?: number;
|
|
385
389
|
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
386
390
|
thumbnail?: Buffer | ReadStream | string;
|
|
391
|
+
/** Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. */
|
|
392
|
+
cover?: Buffer | ReadStream | string;
|
|
393
|
+
/** Start timestamp for the video in the message */
|
|
394
|
+
start_timestamp?: number;
|
|
387
395
|
/** Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing */
|
|
388
396
|
caption?: string;
|
|
389
397
|
/** Mode for parsing entities in the video caption. See formatting options for more details. */
|
|
@@ -859,7 +867,7 @@ export type ApiMethods = {
|
|
|
859
867
|
message_thread_id?: number;
|
|
860
868
|
}): true;
|
|
861
869
|
|
|
862
|
-
/** Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success. */
|
|
870
|
+
/** Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success. */
|
|
863
871
|
setMessageReaction(args: {
|
|
864
872
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
865
873
|
chat_id: number | string;
|
|
@@ -1689,9 +1697,9 @@ export type ApiMethods = {
|
|
|
1689
1697
|
name: string;
|
|
1690
1698
|
/** User identifier of the sticker set owner */
|
|
1691
1699
|
user_id: number;
|
|
1692
|
-
/** A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animation-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail. */
|
|
1700
|
+
/** A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animation-requirements for animated sticker technical requirements), or a .WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail. */
|
|
1693
1701
|
thumbnail?: Buffer | ReadStream | string;
|
|
1694
|
-
/** Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a WEBM video */
|
|
1702
|
+
/** Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a .WEBM video */
|
|
1695
1703
|
format: "static" | "animated" | "video";
|
|
1696
1704
|
}): true;
|
|
1697
1705
|
|
|
@@ -1703,15 +1711,19 @@ export type ApiMethods = {
|
|
|
1703
1711
|
custom_emoji_id?: string;
|
|
1704
1712
|
}): true;
|
|
1705
1713
|
|
|
1706
|
-
/** Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object. */
|
|
1714
|
+
/** Returns the list of gifts that can be sent by the bot to users and chennel chats. Requires no parameters. Returns a Gifts object. */
|
|
1707
1715
|
getAvailableGifts(): Gifts;
|
|
1708
1716
|
|
|
1709
|
-
/** Sends a gift to the given user. The gift can't be converted to Telegram Stars by the
|
|
1717
|
+
/** Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success. */
|
|
1710
1718
|
sendGift(args: {
|
|
1711
|
-
/** Unique identifier of the target user
|
|
1712
|
-
user_id
|
|
1719
|
+
/** Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. */
|
|
1720
|
+
user_id?: number;
|
|
1721
|
+
/** Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift. */
|
|
1722
|
+
chat_id?: number | string;
|
|
1713
1723
|
/** Identifier of the gift */
|
|
1714
1724
|
gift_id: string;
|
|
1725
|
+
/** Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver */
|
|
1726
|
+
pay_for_upgrade?: boolean;
|
|
1715
1727
|
/** Text that will be shown along with the gift; 0-255 characters */
|
|
1716
1728
|
text?: string;
|
|
1717
1729
|
/** Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
|
|
@@ -1883,6 +1895,34 @@ export type ApiMethods = {
|
|
|
1883
1895
|
is_canceled: boolean;
|
|
1884
1896
|
}): true;
|
|
1885
1897
|
|
|
1898
|
+
/** Verifies a user on behalf of the organization which is represented by the bot. Returns True on success. */
|
|
1899
|
+
verifyUser(args: {
|
|
1900
|
+
/** Unique identifier of the target user */
|
|
1901
|
+
user_id: number;
|
|
1902
|
+
/** Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. */
|
|
1903
|
+
custom_description?: string;
|
|
1904
|
+
}): true;
|
|
1905
|
+
|
|
1906
|
+
/** Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success. */
|
|
1907
|
+
verifyChat(args: {
|
|
1908
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1909
|
+
chat_id: number | string;
|
|
1910
|
+
/** Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. */
|
|
1911
|
+
custom_description?: string;
|
|
1912
|
+
}): true;
|
|
1913
|
+
|
|
1914
|
+
/** Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success. */
|
|
1915
|
+
removeUserVerification(args: {
|
|
1916
|
+
/** Unique identifier of the target user */
|
|
1917
|
+
user_id: number;
|
|
1918
|
+
}): true;
|
|
1919
|
+
|
|
1920
|
+
/** Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success. */
|
|
1921
|
+
removeChatVerification(args: {
|
|
1922
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1923
|
+
chat_id: number | string;
|
|
1924
|
+
}): true;
|
|
1925
|
+
|
|
1886
1926
|
/** If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned. */
|
|
1887
1927
|
answerShippingQuery(args: {
|
|
1888
1928
|
/** Unique identifier for the query to be answered */
|
|
@@ -1891,7 +1931,7 @@ export type ApiMethods = {
|
|
|
1891
1931
|
ok: boolean;
|
|
1892
1932
|
/** Required if ok is True. An array of available shipping options. */
|
|
1893
1933
|
shipping_options?: readonly ShippingOption[];
|
|
1894
|
-
/** Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable
|
|
1934
|
+
/** Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable"). Telegram will display this message to the user. */
|
|
1895
1935
|
error_message?: string;
|
|
1896
1936
|
}): true;
|
|
1897
1937
|
|
|
@@ -1992,7 +2032,7 @@ export type ApiMethods = {
|
|
|
1992
2032
|
export interface InputSticker {
|
|
1993
2033
|
/** The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. Animated and video stickers can't be uploaded via HTTP URL. */
|
|
1994
2034
|
sticker: Buffer | ReadStream | string;
|
|
1995
|
-
/** Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a WEBM video */
|
|
2035
|
+
/** Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video */
|
|
1996
2036
|
format: "static" | "animated" | "video";
|
|
1997
2037
|
/** List of 1-20 emoji associated with the sticker */
|
|
1998
2038
|
emoji_list: string[];
|
|
@@ -2041,6 +2081,10 @@ export interface InputMediaVideo {
|
|
|
2041
2081
|
media: Buffer | ReadStream | string;
|
|
2042
2082
|
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
2043
2083
|
thumbnail?: Buffer | ReadStream | string;
|
|
2084
|
+
/** Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. */
|
|
2085
|
+
cover?: Buffer | ReadStream | string;
|
|
2086
|
+
/** Start timestamp for the video in the message */
|
|
2087
|
+
start_timestamp?: number;
|
|
2044
2088
|
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
2045
2089
|
caption?: string;
|
|
2046
2090
|
/** Pass True, if the caption must be shown above the message media */
|
|
@@ -2148,6 +2192,10 @@ export interface InputPaidMediaVideo {
|
|
|
2148
2192
|
media: Buffer | ReadStream | string;
|
|
2149
2193
|
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2150
2194
|
thumbnail?: Buffer | ReadStream | string;
|
|
2195
|
+
/** Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. */
|
|
2196
|
+
cover?: Buffer | ReadStream | string;
|
|
2197
|
+
/** Start timestamp for the video in the message */
|
|
2198
|
+
start_timestamp?: number;
|
|
2151
2199
|
/** Video width */
|
|
2152
2200
|
width?: number;
|
|
2153
2201
|
/** Video height */
|
package/src/inlineTypes.d.ts
CHANGED
|
@@ -80,8 +80,6 @@ export interface InlineQueryResultArticle {
|
|
|
80
80
|
reply_markup?: InlineKeyboardMarkup;
|
|
81
81
|
/** URL of the result */
|
|
82
82
|
url?: string;
|
|
83
|
-
/** Pass True if you don't want the URL to be shown in the message */
|
|
84
|
-
hide_url?: boolean;
|
|
85
83
|
/** Short description of the result */
|
|
86
84
|
description?: string;
|
|
87
85
|
/** Url of the thumbnail for the result */
|
|
@@ -128,7 +126,7 @@ export interface InlineQueryResultGif {
|
|
|
128
126
|
type: "gif";
|
|
129
127
|
/** Unique identifier for this result, 1-64 bytes */
|
|
130
128
|
id: string;
|
|
131
|
-
/** A valid URL for the GIF file
|
|
129
|
+
/** A valid URL for the GIF file */
|
|
132
130
|
gif_url: string;
|
|
133
131
|
/** Width of the GIF */
|
|
134
132
|
gif_width?: number;
|
|
@@ -161,7 +159,7 @@ export interface InlineQueryResultMpeg4Gif {
|
|
|
161
159
|
type: "mpeg4_gif";
|
|
162
160
|
/** Unique identifier for this result, 1-64 bytes */
|
|
163
161
|
id: string;
|
|
164
|
-
/** A valid URL for the MPEG4 file
|
|
162
|
+
/** A valid URL for the MPEG4 file */
|
|
165
163
|
mpeg4_url: string;
|
|
166
164
|
/** Video width */
|
|
167
165
|
mpeg4_width?: number;
|
package/src/invoiceTypes.d.ts
CHANGED
|
@@ -178,6 +178,7 @@ export interface AffiliateInfo {
|
|
|
178
178
|
/** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
|
|
179
179
|
|
|
180
180
|
- TransactionPartnerUser
|
|
181
|
+
- TransactionPartnerChat
|
|
181
182
|
- TransactionPartnerFragment
|
|
182
183
|
- TransactionPartnerAffiliateProgram
|
|
183
184
|
- TransactionPartnerTelegramAds
|
|
@@ -208,7 +209,17 @@ export interface TransactionPartnerUser {
|
|
|
208
209
|
/** Bot-specified paid media payload */
|
|
209
210
|
paid_media_payload?: string;
|
|
210
211
|
/** The gift sent to the user by the bot */
|
|
211
|
-
gift?:
|
|
212
|
+
gift?: Gift;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Describes a transaction with a chat. */
|
|
216
|
+
export interface TransactionPartnerChat {
|
|
217
|
+
/** Type of the transaction partner, always “chat” */
|
|
218
|
+
type: "chat";
|
|
219
|
+
/** Information about the chat */
|
|
220
|
+
chat: Chat;
|
|
221
|
+
/** The gift sent to the chat by the bot */
|
|
222
|
+
gift?: Gift;
|
|
212
223
|
}
|
|
213
224
|
|
|
214
225
|
/** Describes the affiliate program that issued the affiliate commission received via this transaction. */
|
|
@@ -287,6 +298,8 @@ export interface Gift {
|
|
|
287
298
|
sticker: Sticker;
|
|
288
299
|
/** The number of Telegram Stars that must be paid to send the sticker */
|
|
289
300
|
star_count: number;
|
|
301
|
+
/** The number of Telegram Stars that must be paid to upgrade the gift to a unique one */
|
|
302
|
+
upgrade_star_count?: number;
|
|
290
303
|
/** The total number of the gifts of this type that can be sent; for limited gifts only */
|
|
291
304
|
total_count?: number;
|
|
292
305
|
/** The number of remaining gifts of this type that can be sent; for limited gifts only */
|
package/src/messageTypes.d.ts
CHANGED
|
@@ -712,6 +712,10 @@ export interface Video {
|
|
|
712
712
|
duration: number;
|
|
713
713
|
/** Video thumbnail */
|
|
714
714
|
thumbnail?: PhotoSize;
|
|
715
|
+
/** Available sizes of the cover of the video in the message */
|
|
716
|
+
cover?: PhotoSize[];
|
|
717
|
+
/** Timestamp in seconds from which the video will play in the message */
|
|
718
|
+
start_timestamp?: number;
|
|
715
719
|
/** Original filename as defined by sender */
|
|
716
720
|
file_name?: string;
|
|
717
721
|
/** MIME type of the file as defined by sender */
|
|
@@ -1041,7 +1045,7 @@ export interface BackgroundTypeWallpaper {
|
|
|
1041
1045
|
is_moving?: true;
|
|
1042
1046
|
}
|
|
1043
1047
|
|
|
1044
|
-
/** The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
|
|
1048
|
+
/** The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
|
|
1045
1049
|
export interface BackgroundTypePattern {
|
|
1046
1050
|
/** Type of the background, always “pattern” */
|
|
1047
1051
|
type: "pattern";
|