Skip to content

Commit 4a0a112

Browse files
authored
merge: #9 from telegraf/feat/api-8.3
2 parents ee8ca94 + b5ae700 commit 4a0a112

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

methods.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ export type ApiMethods<F> = {
180180
message_thread_id?: number;
181181
/** Unique identifier for the chat where the original message was sent (or channel username in the format `@channelusername`) */
182182
from_chat_id: number | string;
183+
/** New start timestamp for the forwarded video in the message */
184+
video_start_timestamp?: number;
183185
/** Sends the message silently. Users will receive a notification with no sound. */
184186
disable_notification?: boolean;
185187
/** Protects the contents of the forwarded message from forwarding and saving */
@@ -214,6 +216,8 @@ export type ApiMethods<F> = {
214216
from_chat_id: number | string;
215217
/** Message identifier in the chat specified in from_chat_id */
216218
message_id: number;
219+
/** New start timestamp for the copied video in the message */
220+
video_start_timestamp?: number;
217221
/** New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept */
218222
caption?: string;
219223
/** Mode for parsing entities in the new caption. See formatting options for more details. */
@@ -832,7 +836,7 @@ export type ApiMethods<F> = {
832836
| "upload_video_note";
833837
}): true;
834838

835-
/** 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. Bots can't use paid reactions. Returns True on success. */
839+
/** 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. Bots can't use paid reactions. Returns True on success. */
836840
setMessageReaction(args: {
837841
/** Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) */
838842
chat_id: number | string;
@@ -1730,13 +1734,15 @@ export type ApiMethods<F> = {
17301734
name: string;
17311735
}): true;
17321736

1733-
/** Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object. */
1737+
/** Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object. */
17341738
getAvailableGifts(): Gifts;
17351739

1736-
/** Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success. */
1740+
/** 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. */
17371741
sendGift(args: {
1738-
/** Unique identifier of the target user that will receive the gift */
1739-
user_id: number;
1742+
/** Required if chat_id is not specified. Unique identifier of the target user who will receive the gift */
1743+
user_id?: number;
1744+
/** 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 */
1745+
chat_id?: number | string;
17401746
/** Identifier of the gift */
17411747
gift_id: string;
17421748
/** Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver */
@@ -2099,6 +2105,10 @@ export interface InputMediaVideo<F> {
20992105
media: F | string;
21002106
/** 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. Thumbnails can't be reused and can be only uploaded as a new file. Use Telegraf's [Input helpers](https://telegraf.js.org/modules/Input.html) to upload a new thumbnail. */
21012107
thumbnail?: F;
2108+
/** 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 use Telegraf's [Input helpers](https://telegraf.js.org/modules/Input.html) to upload a new one. */
2109+
cover?: F | string;
2110+
/** Start timestamp for the video in the message */
2111+
start_timestamp?: number;
21022112
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
21032113
caption?: string;
21042114
/** Mode for parsing entities in the video caption. See formatting options for more details. */
@@ -2208,6 +2218,10 @@ export interface InputPaidMediaVideo<F> {
22082218
media: F | string;
22092219
/** 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. Thumbnails can't be reused and can be only uploaded as a new file. Use Telegraf's [Input helpers](https://telegraf.js.org/modules/Input.html) to upload a new thumbnail. */
22102220
thumbnail?: F | string;
2221+
/** 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 use Telegraf's [Input helpers](https://telegraf.js.org/modules/Input.html) to upload a new one. */
2222+
cover?: F | string;
2223+
/** Start timestamp for the video in the message */
2224+
start_timestamp?: number;
22112225
/** Video width */
22122226
width?: number;
22132227
/** Video height */

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@telegraf/types",
33
"private": false,
4-
"version": "8.2.0",
4+
"version": "8.3.0",
55
"description": "Type declarations for the Telegram API",
66
"main": "index.js",
77
"repository": {

payment.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,15 @@ export interface AffiliateInfo {
186186
/** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
187187
188188
- TransactionPartnerUser
189+
- TransactionPartnerChat
189190
- TransactionPartnerAffiliateProgram
190191
- TransactionPartnerFragment
191192
- TransactionPartnerTelegramAds
192193
- TransactionPartnerTelegramApi
193194
- TransactionPartnerOther */
194195
export type TransactionPartner =
195196
| TransactionPartnerUser
197+
| TransactionPartnerChat
196198
| TransactionPartnerAffiliateProgram
197199
| TransactionPartnerFragment
198200
| TransactionPartnerTelegramAds
@@ -219,6 +221,16 @@ export interface TransactionPartnerUser {
219221
gift?: Gift;
220222
}
221223

224+
/** Describes a transaction with a chat. */
225+
export interface TransactionPartnerChat {
226+
/** Type of the transaction partner, always “chat” */
227+
type: "chat";
228+
/** Information about the chat */
229+
chat: Chat;
230+
/** The gift sent to the chat by the bot */
231+
gift?: Gift;
232+
}
233+
222234
/** Describes the affiliate program that issued the affiliate commission received via this transaction. */
223235
export interface TransactionPartnerAffiliateProgram {
224236
/** Type of the transaction partner, always “affiliate_program” */

0 commit comments

Comments
 (0)