@telegram.ts/types 1.20.0 → 1.21.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.20.0",
3
+ "version": "1.21.1",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -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;
@@ -1703,13 +1711,15 @@ 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 user. Returns True on success. */
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 that will receive the gift */
1712
- user_id: number;
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;
1715
1725
  /** Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver */
@@ -1921,7 +1931,7 @@ export type ApiMethods = {
1921
1931
  ok: boolean;
1922
1932
  /** Required if ok is True. An array of available shipping options. */
1923
1933
  shipping_options?: readonly ShippingOption[];
1924
- /** 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. */
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. */
1925
1935
  error_message?: string;
1926
1936
  }): true;
1927
1937
 
@@ -2071,6 +2081,10 @@ export interface InputMediaVideo {
2071
2081
  media: Buffer | ReadStream | string;
2072
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>. */
2073
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;
2074
2088
  /** Caption of the video to be sent, 0-1024 characters after entities parsing */
2075
2089
  caption?: string;
2076
2090
  /** Pass True, if the caption must be shown above the message media */
@@ -2178,6 +2192,10 @@ export interface InputPaidMediaVideo {
2178
2192
  media: Buffer | ReadStream | string;
2179
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 » */
2180
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;
2181
2199
  /** Video width */
2182
2200
  width?: number;
2183
2201
  /** Video height */
@@ -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
@@ -185,6 +186,7 @@ export interface AffiliateInfo {
185
186
  - TransactionPartnerOther */
186
187
  export type TransactionPartner =
187
188
  | TransactionPartnerUser
189
+ | TransactionPartnerChat
188
190
  | TransactionPartnerFragment
189
191
  | TransactionPartnerAffiliateProgram
190
192
  | TransactionPartnerTelegramAds
@@ -208,7 +210,17 @@ export interface TransactionPartnerUser {
208
210
  /** Bot-specified paid media payload */
209
211
  paid_media_payload?: string;
210
212
  /** The gift sent to the user by the bot */
211
- gift?: string;
213
+ gift?: Gift;
214
+ }
215
+
216
+ /** Describes a transaction with a chat. */
217
+ export interface TransactionPartnerChat {
218
+ /** Type of the transaction partner, always “chat” */
219
+ type: "chat";
220
+ /** Information about the chat */
221
+ chat: Chat;
222
+ /** The gift sent to the chat by the bot */
223
+ gift?: Gift;
212
224
  }
213
225
 
214
226
  /** Describes the affiliate program that issued the affiliate commission received via this transaction. */
@@ -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 */