@grammyjs/types 3.18.0 → 3.20.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/manage.d.ts +60 -10
- package/message.d.ts +18 -3
- package/methods.d.ts +264 -13
- package/mod.d.ts +1 -0
- package/package.json +1 -1
- package/payment.d.ts +182 -11
- package/story.d.ts +89 -0
package/manage.d.ts
CHANGED
|
@@ -21,6 +21,17 @@ export interface WebhookInfo {
|
|
|
21
21
|
/** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */
|
|
22
22
|
allowed_updates?: Array<Exclude<keyof Update, "update_id">>;
|
|
23
23
|
}
|
|
24
|
+
/** This object describes the types of gifts that can be gifted to a user or a chat. */
|
|
25
|
+
export interface AcceptedGiftTypes {
|
|
26
|
+
/** True, if unlimited regular gifts are accepted */
|
|
27
|
+
unlimited_gifts: boolean;
|
|
28
|
+
/** True, if limited regular gifts are accepted */
|
|
29
|
+
limited_gifts: boolean;
|
|
30
|
+
/** True, if unique gifts or gifts that can be upgraded to unique for free are accepted */
|
|
31
|
+
unique_gifts: boolean;
|
|
32
|
+
/** True, if a Telegram Premium subscription is accepted */
|
|
33
|
+
premium_subscription: boolean;
|
|
34
|
+
}
|
|
24
35
|
/** This object represents a Telegram user or bot. */
|
|
25
36
|
export interface User {
|
|
26
37
|
/** Unique identifier for this user or bot. */
|
|
@@ -192,6 +203,10 @@ export declare namespace ChatFullInfo {
|
|
|
192
203
|
pinned_message?: Message;
|
|
193
204
|
/** Default chat member permissions, for groups and supergroups */
|
|
194
205
|
permissions?: undefined;
|
|
206
|
+
/** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
|
|
207
|
+
accepted_gift_types: AcceptedGiftTypes;
|
|
208
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
209
|
+
can_send_paid_media?: undefined;
|
|
195
210
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
196
211
|
slow_mode_delay?: undefined;
|
|
197
212
|
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
@@ -216,8 +231,6 @@ export declare namespace ChatFullInfo {
|
|
|
216
231
|
linked_chat_id?: undefined;
|
|
217
232
|
/** For supergroups, the location to which the supergroup is connected */
|
|
218
233
|
location?: undefined;
|
|
219
|
-
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
220
|
-
can_send_paid_media?: undefined;
|
|
221
234
|
}
|
|
222
235
|
/** Internal type for group chats */
|
|
223
236
|
interface GroupChat {
|
|
@@ -283,6 +296,10 @@ export declare namespace ChatFullInfo {
|
|
|
283
296
|
pinned_message?: Message;
|
|
284
297
|
/** Default chat member permissions, for groups and supergroups */
|
|
285
298
|
permissions?: ChatPermissions;
|
|
299
|
+
/** True, if gifts can be sent to the chat */
|
|
300
|
+
can_send_gift?: true;
|
|
301
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
302
|
+
can_send_paid_media?: undefined;
|
|
286
303
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
287
304
|
slow_mode_delay?: undefined;
|
|
288
305
|
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
@@ -307,8 +324,6 @@ export declare namespace ChatFullInfo {
|
|
|
307
324
|
linked_chat_id?: undefined;
|
|
308
325
|
/** For supergroups, the location to which the supergroup is connected */
|
|
309
326
|
location?: undefined;
|
|
310
|
-
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
311
|
-
can_send_paid_media?: undefined;
|
|
312
327
|
}
|
|
313
328
|
/** Internal type for supergroup chats */
|
|
314
329
|
interface SupergroupChat {
|
|
@@ -374,6 +389,10 @@ export declare namespace ChatFullInfo {
|
|
|
374
389
|
pinned_message?: Message;
|
|
375
390
|
/** Default chat member permissions, for groups and supergroups */
|
|
376
391
|
permissions?: ChatPermissions;
|
|
392
|
+
/** True, if gifts can be sent to the chat */
|
|
393
|
+
can_send_gift?: true;
|
|
394
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
395
|
+
can_send_paid_media?: undefined;
|
|
377
396
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
378
397
|
slow_mode_delay?: number;
|
|
379
398
|
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
@@ -398,8 +417,6 @@ export declare namespace ChatFullInfo {
|
|
|
398
417
|
linked_chat_id?: number;
|
|
399
418
|
/** For supergroups, the location to which the supergroup is connected */
|
|
400
419
|
location?: ChatLocation;
|
|
401
|
-
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
402
|
-
can_send_paid_media?: undefined;
|
|
403
420
|
}
|
|
404
421
|
/** Internal type for channel chats */
|
|
405
422
|
interface ChannelChat {
|
|
@@ -465,6 +482,10 @@ export declare namespace ChatFullInfo {
|
|
|
465
482
|
pinned_message?: Message;
|
|
466
483
|
/** Default chat member permissions, for groups and supergroups */
|
|
467
484
|
permissions?: undefined;
|
|
485
|
+
/** True, if gifts can be sent to the chat */
|
|
486
|
+
can_send_gift?: true;
|
|
487
|
+
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
488
|
+
can_send_paid_media?: true;
|
|
468
489
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
469
490
|
slow_mode_delay?: undefined;
|
|
470
491
|
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
@@ -489,8 +510,6 @@ export declare namespace ChatFullInfo {
|
|
|
489
510
|
linked_chat_id?: number;
|
|
490
511
|
/** For supergroups, the location to which the supergroup is connected */
|
|
491
512
|
location?: undefined;
|
|
492
|
-
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
493
|
-
can_send_paid_media?: true;
|
|
494
513
|
}
|
|
495
514
|
}
|
|
496
515
|
/** This object contains full information about a chat. */
|
|
@@ -893,6 +912,37 @@ export interface UserChatBoosts {
|
|
|
893
912
|
/** The list of boosts added to the chat by the user */
|
|
894
913
|
boosts: ChatBoost[];
|
|
895
914
|
}
|
|
915
|
+
/** Represents the rights of a business bot. */
|
|
916
|
+
export interface BusinessBotRights {
|
|
917
|
+
/** True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours */
|
|
918
|
+
can_reply?: true;
|
|
919
|
+
/** True, if the bot can mark incoming private messages as read */
|
|
920
|
+
can_read_messages?: true;
|
|
921
|
+
/** True, if the bot can delete messages sent by the bot */
|
|
922
|
+
can_delete_outgoing_messages?: true;
|
|
923
|
+
/** True, if the bot can delete all private messages in managed chats */
|
|
924
|
+
can_delete_all_messages?: true;
|
|
925
|
+
/** True, if the bot can edit the first and last name of the business account */
|
|
926
|
+
can_edit_name?: true;
|
|
927
|
+
/** True, if the bot can edit the bio of the business account */
|
|
928
|
+
can_edit_bio?: true;
|
|
929
|
+
/** True, if the bot can edit the profile photo of the business account */
|
|
930
|
+
can_edit_profile_photo?: true;
|
|
931
|
+
/** True, if the bot can edit the username of the business account */
|
|
932
|
+
can_edit_username?: true;
|
|
933
|
+
/** True, if the bot can change the privacy settings pertaining to gifts for the business account */
|
|
934
|
+
can_change_gift_settings?: true;
|
|
935
|
+
/** True, if the bot can view gifts and the amount of Telegram Stars owned by the business account */
|
|
936
|
+
can_view_gifts_and_stars?: true;
|
|
937
|
+
/** True, if the bot can convert regular gifts owned by the business account to Telegram Stars */
|
|
938
|
+
can_convert_gifts_to_stars?: true;
|
|
939
|
+
/** True, if the bot can transfer and upgrade gifts owned by the business account */
|
|
940
|
+
can_transfer_and_upgrade_gifts?: true;
|
|
941
|
+
/** True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts */
|
|
942
|
+
can_transfer_stars?: true;
|
|
943
|
+
/** True, if the bot can post, edit and delete stories on behalf of the business account */
|
|
944
|
+
can_manage_stories?: true;
|
|
945
|
+
}
|
|
896
946
|
/** Describes the connection of the bot with a business account. */
|
|
897
947
|
export interface BusinessConnection {
|
|
898
948
|
/** Unique identifier of the business connection */
|
|
@@ -903,8 +953,8 @@ export interface BusinessConnection {
|
|
|
903
953
|
user_chat_id: number;
|
|
904
954
|
/** Date the connection was established in Unix time */
|
|
905
955
|
date: number;
|
|
906
|
-
/**
|
|
907
|
-
|
|
956
|
+
/** Rights of the business bot */
|
|
957
|
+
rights?: BusinessBotRights;
|
|
908
958
|
/** True, if the connection is active */
|
|
909
959
|
is_enabled: boolean;
|
|
910
960
|
}
|
package/message.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Chat, User } from "./manage.js";
|
|
2
2
|
import type { InlineKeyboardMarkup } from "./markup.js";
|
|
3
3
|
import type { PassportData } from "./passport.js";
|
|
4
|
-
import type { Invoice, RefundedPayment, SuccessfulPayment } from "./payment.js";
|
|
4
|
+
import type { GiftInfo, Invoice, PaidMessagePriceChanged, RefundedPayment, SuccessfulPayment, UniqueGiftInfo } from "./payment.js";
|
|
5
5
|
type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
|
|
6
6
|
export declare namespace Message {
|
|
7
7
|
interface ServiceMessage {
|
|
@@ -55,6 +55,8 @@ export declare namespace Message {
|
|
|
55
55
|
link_preview_options?: LinkPreviewOptions;
|
|
56
56
|
/** Unique identifier of the message effect added to the message */
|
|
57
57
|
effect_id?: string;
|
|
58
|
+
/** The number of Telegram Stars that were paid by the sender of the message to send it */
|
|
59
|
+
paid_star_count?: number;
|
|
58
60
|
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
|
|
59
61
|
reply_markup?: InlineKeyboardMarkup;
|
|
60
62
|
}
|
|
@@ -120,6 +122,9 @@ export declare namespace Message {
|
|
|
120
122
|
type GiveawayMessage = ServiceMessage & MsgWith<"giveaway">;
|
|
121
123
|
type GiveawayWinnersMessage = ServiceMessage & MsgWith<"giveaway_winners">;
|
|
122
124
|
type GiveawayCompletedMessage = ServiceMessage & MsgWith<"giveaway_completed">;
|
|
125
|
+
type GiftMessage = ServiceMessage & MsgWith<"gift">;
|
|
126
|
+
type UniqueGiftMessage = ServiceMessage & MsgWith<"unique_gift">;
|
|
127
|
+
type PaidMessagePriceChangedMessage = ServiceMessage & MsgWith<"paid_message_price_changed">;
|
|
123
128
|
type VideoChatScheduledMessage = ServiceMessage & MsgWith<"video_chat_scheduled">;
|
|
124
129
|
type VideoChatStartedMessage = ServiceMessage & MsgWith<"video_chat_started">;
|
|
125
130
|
type VideoChatEndedMessage = ServiceMessage & MsgWith<"video_chat_ended">;
|
|
@@ -232,6 +237,12 @@ export interface Message extends Message.MediaMessage {
|
|
|
232
237
|
giveaway_winners?: GiveawayWinners;
|
|
233
238
|
/** Service message: a giveaway without public winners was completed */
|
|
234
239
|
giveaway_completed?: GiveawayCompleted;
|
|
240
|
+
/** Service message: a regular gift was sent or received */
|
|
241
|
+
gift?: GiftInfo;
|
|
242
|
+
/** Service message: a unique gift was sent or received */
|
|
243
|
+
unique_gift?: UniqueGiftInfo;
|
|
244
|
+
/** Service message: the price for paid messages has changed in the chat */
|
|
245
|
+
paid_message_price_changed?: PaidMessagePriceChanged;
|
|
235
246
|
/** Service message: video chat scheduled */
|
|
236
247
|
video_chat_scheduled?: VideoChatScheduled;
|
|
237
248
|
/** Service message: video chat started */
|
|
@@ -487,7 +498,7 @@ export interface ReplyParameters {
|
|
|
487
498
|
/** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message. */
|
|
488
499
|
quote?: string;
|
|
489
500
|
/** Mode for parsing entities in the quote. See formatting options for more details. */
|
|
490
|
-
quote_parse_mode?:
|
|
501
|
+
quote_parse_mode?: ParseMode;
|
|
491
502
|
/** A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. */
|
|
492
503
|
quote_entities?: MessageEntity[];
|
|
493
504
|
/** Position of the quote in the original message in UTF-16 code units */
|
|
@@ -633,6 +644,10 @@ export interface Video {
|
|
|
633
644
|
duration: number;
|
|
634
645
|
/** Video thumbnail */
|
|
635
646
|
thumbnail?: PhotoSize;
|
|
647
|
+
/** Available sizes of the cover of the video in the message */
|
|
648
|
+
cover?: PhotoSize[];
|
|
649
|
+
/** Timestamp in seconds from which the video will play in the message */
|
|
650
|
+
start_timestamp?: number;
|
|
636
651
|
/** Original filename as defined by sender */
|
|
637
652
|
file_name?: string;
|
|
638
653
|
/** MIME type of the file as defined by sender */
|
|
@@ -702,7 +717,7 @@ export interface InputPollOption {
|
|
|
702
717
|
/** Option text, 1-100 characters */
|
|
703
718
|
text: string;
|
|
704
719
|
/** Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed */
|
|
705
|
-
text_parse_mode?:
|
|
720
|
+
text_parse_mode?: ParseMode;
|
|
706
721
|
/** A list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode */
|
|
707
722
|
text_entities?: MessageEntity[];
|
|
708
723
|
}
|
package/methods.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { InlineQueryResult, InlineQueryResultsButton } from "./inline.js";
|
|
2
2
|
import type { LanguageCode } from "./langs.js";
|
|
3
|
-
import type { BotCommand, BusinessConnection, ChatAdministratorRights, ChatFullInfo, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
|
|
3
|
+
import type { AcceptedGiftTypes, BotCommand, BusinessConnection, ChatAdministratorRights, ChatFullInfo, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
|
|
4
4
|
import type { ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "./markup.js";
|
|
5
|
-
import type { File, GameHighScore, InputPollOption, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, PreparedInlineMessage, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet } from "./message.js";
|
|
5
|
+
import type { File, GameHighScore, InputPollOption, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, PreparedInlineMessage, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet, Story } from "./message.js";
|
|
6
6
|
import type { PassportElementError } from "./passport.js";
|
|
7
|
-
import type { Gifts, LabeledPrice, ShippingOption, StarTransactions } from "./payment.js";
|
|
7
|
+
import type { Gifts, LabeledPrice, OwnedGifts, ShippingOption, StarAmount, StarTransactions } from "./payment.js";
|
|
8
8
|
import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
|
|
9
|
+
import { StoryArea } from "./story.js";
|
|
9
10
|
import type { Update } from "./update.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]>;
|
|
@@ -112,6 +113,8 @@ export type ApiMethods<F> = {
|
|
|
112
113
|
message_thread_id?: number;
|
|
113
114
|
/** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
|
|
114
115
|
from_chat_id: number | string;
|
|
116
|
+
/** New start timestamp for the copied video in the message */
|
|
117
|
+
video_start_timestamp?: number;
|
|
115
118
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
116
119
|
disable_notification?: boolean;
|
|
117
120
|
/** Protects the contents of the forwarded message from forwarding and saving */
|
|
@@ -144,10 +147,12 @@ export type ApiMethods<F> = {
|
|
|
144
147
|
from_chat_id: number | string;
|
|
145
148
|
/** Message identifier in the chat specified in from_chat_id */
|
|
146
149
|
message_id: number;
|
|
150
|
+
/** New start timestamp for the copied video in the message */
|
|
151
|
+
video_start_timestamp?: number;
|
|
147
152
|
/** New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept */
|
|
148
153
|
caption?: string;
|
|
149
154
|
/** Mode for parsing entities in the new caption. See formatting options for more details. */
|
|
150
|
-
parse_mode?:
|
|
155
|
+
parse_mode?: ParseMode;
|
|
151
156
|
/** A list of special entities that appear in the new caption, which can be specified instead of parse_mode */
|
|
152
157
|
caption_entities?: MessageEntity[];
|
|
153
158
|
/** Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. */
|
|
@@ -311,6 +316,10 @@ export type ApiMethods<F> = {
|
|
|
311
316
|
height?: number;
|
|
312
317
|
/** 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>. */
|
|
313
318
|
thumbnail?: F;
|
|
319
|
+
/** 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. */
|
|
320
|
+
cover?: F | string;
|
|
321
|
+
/** Start timestamp for the video in the message */
|
|
322
|
+
start_timestamp?: number;
|
|
314
323
|
/** Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing */
|
|
315
324
|
caption?: string;
|
|
316
325
|
/** Mode for parsing entities in the video caption. See formatting options for more details. */
|
|
@@ -557,7 +566,7 @@ export type ApiMethods<F> = {
|
|
|
557
566
|
/** Media caption, 0-1024 characters after entities parsing */
|
|
558
567
|
caption?: string;
|
|
559
568
|
/** Mode for parsing entities in the media caption. See formatting options for more details. */
|
|
560
|
-
parse_mode?:
|
|
569
|
+
parse_mode?: ParseMode;
|
|
561
570
|
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
562
571
|
caption_entities?: MessageEntity[];
|
|
563
572
|
/** Pass True, if the caption must be shown above the message media */
|
|
@@ -654,7 +663,7 @@ export type ApiMethods<F> = {
|
|
|
654
663
|
/** Poll question, 1-300 characters */
|
|
655
664
|
question: string;
|
|
656
665
|
/** Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed */
|
|
657
|
-
question_parse_mode?:
|
|
666
|
+
question_parse_mode?: ParseMode;
|
|
658
667
|
/** A list of special entities that appear in the poll question. It can be specified instead of question_parse_mode */
|
|
659
668
|
question_entities?: MessageEntity[];
|
|
660
669
|
/** A list of 2-10 answer options */
|
|
@@ -734,7 +743,7 @@ export type ApiMethods<F> = {
|
|
|
734
743
|
/** Unique identifier for the target message thread; for supergroups only */
|
|
735
744
|
message_thread_id?: number;
|
|
736
745
|
}): true;
|
|
737
|
-
/** 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. */
|
|
746
|
+
/** 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. */
|
|
738
747
|
setMessageReaction(args: {
|
|
739
748
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
740
749
|
chat_id: number | string;
|
|
@@ -1344,6 +1353,168 @@ export type ApiMethods<F> = {
|
|
|
1344
1353
|
/** A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted */
|
|
1345
1354
|
message_ids: number[];
|
|
1346
1355
|
}): true;
|
|
1356
|
+
/** Delete messages on behalf of a business account. Requires the can_delete_outgoing_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success. */
|
|
1357
|
+
deleteBusinessMessages(args: {
|
|
1358
|
+
/** Unique identifier of the business connection on behalf of which to delete the messages */
|
|
1359
|
+
business_connection_id: string;
|
|
1360
|
+
/** A list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted */
|
|
1361
|
+
message_ids: number[];
|
|
1362
|
+
}): true;
|
|
1363
|
+
/** Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success. */
|
|
1364
|
+
setBusinessAccountName(args: {
|
|
1365
|
+
/** Unique identifier of the business connection */
|
|
1366
|
+
business_connection_id: string;
|
|
1367
|
+
/** The new value of the first name for the business account; 1-64 characters */
|
|
1368
|
+
first_name: string;
|
|
1369
|
+
/** The new value of the last name for the business account; 0-64 characters */
|
|
1370
|
+
last_name?: string;
|
|
1371
|
+
}): true;
|
|
1372
|
+
/** Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success. */
|
|
1373
|
+
setBusinessAccountUsername(args: {
|
|
1374
|
+
/** Unique identifier of the business connection */
|
|
1375
|
+
business_connection_id: string;
|
|
1376
|
+
/** The new value of the username for the business account; 0-32 characters */
|
|
1377
|
+
username?: string;
|
|
1378
|
+
}): true;
|
|
1379
|
+
/** Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success. */
|
|
1380
|
+
setBusinessAccountBio(args: {
|
|
1381
|
+
/** Unique identifier of the business connection */
|
|
1382
|
+
business_connection_id: string;
|
|
1383
|
+
/** The new value of the bio for the business account; 0-140 characters */
|
|
1384
|
+
bio?: string;
|
|
1385
|
+
}): true;
|
|
1386
|
+
/** Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. */
|
|
1387
|
+
setBusinessAccountProfilePhoto(args: {
|
|
1388
|
+
/** Unique identifier of the business connection */
|
|
1389
|
+
business_connection_id: string;
|
|
1390
|
+
/** The new profile photo to set */
|
|
1391
|
+
photo: InputProfilePhoto<F>;
|
|
1392
|
+
/** Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo. */
|
|
1393
|
+
is_public?: boolean;
|
|
1394
|
+
}): true;
|
|
1395
|
+
/** Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. */
|
|
1396
|
+
removeBusinessAccountProfilePhoto(args: {
|
|
1397
|
+
/** Unique identifier of the business connection */
|
|
1398
|
+
business_connection_id: string;
|
|
1399
|
+
/** Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo. */
|
|
1400
|
+
is_public?: boolean;
|
|
1401
|
+
}): true;
|
|
1402
|
+
/** Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success. */
|
|
1403
|
+
setBusinessAccountGiftSettings(args: {
|
|
1404
|
+
/** Unique identifier of the business connection */
|
|
1405
|
+
business_connection_id: string;
|
|
1406
|
+
/** Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field */
|
|
1407
|
+
show_gift_button: boolean;
|
|
1408
|
+
/** Types of gifts accepted by the business account */
|
|
1409
|
+
accepted_gift_types: AcceptedGiftTypes;
|
|
1410
|
+
}): true;
|
|
1411
|
+
/** Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success. */
|
|
1412
|
+
getBusinessAccountStarBalance(args: {
|
|
1413
|
+
/** Unique identifier of the business connection */
|
|
1414
|
+
business_connection_id: string;
|
|
1415
|
+
}): StarAmount;
|
|
1416
|
+
/** Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success. */
|
|
1417
|
+
transferBusinessAccountStars(args: {
|
|
1418
|
+
/** Unique identifier of the business connection */
|
|
1419
|
+
business_connection_id: string;
|
|
1420
|
+
/** Number of Telegram Stars to transfer; 1-10000 */
|
|
1421
|
+
star_count: number;
|
|
1422
|
+
}): true;
|
|
1423
|
+
/** Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success. */
|
|
1424
|
+
getBusinessAccountGifts(args: {
|
|
1425
|
+
/** Unique identifier of the business connection */
|
|
1426
|
+
business_connection_id: string;
|
|
1427
|
+
/** Pass True to exclude gifts that aren't saved to the account's profile page */
|
|
1428
|
+
exclude_unsaved?: boolean;
|
|
1429
|
+
/** Pass True to exclude gifts that are saved to the account's profile page */
|
|
1430
|
+
exclude_saved?: boolean;
|
|
1431
|
+
/** Pass True to exclude gifts that can be purchased an unlimited number of times */
|
|
1432
|
+
exclude_unlimited?: boolean;
|
|
1433
|
+
/** Pass True to exclude gifts that can be purchased a limited number of times */
|
|
1434
|
+
exclude_limited?: boolean;
|
|
1435
|
+
/** Pass True to exclude unique gifts */
|
|
1436
|
+
exclude_unique?: boolean;
|
|
1437
|
+
/** Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. */
|
|
1438
|
+
sort_by_price?: boolean;
|
|
1439
|
+
/** Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results */
|
|
1440
|
+
offset?: string;
|
|
1441
|
+
/** The maximum number of gifts to be returned; 1-100. Defaults to 100 */
|
|
1442
|
+
limit?: number;
|
|
1443
|
+
}): OwnedGifts;
|
|
1444
|
+
/** Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success. */
|
|
1445
|
+
convertGiftToStars(args: {
|
|
1446
|
+
/** Unique identifier of the business connection */
|
|
1447
|
+
business_connection_id: string;
|
|
1448
|
+
/** Unique identifier of the regular gift that should be converted to Telegram Stars */
|
|
1449
|
+
owned_gift_id: string;
|
|
1450
|
+
}): true;
|
|
1451
|
+
/** Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success. */
|
|
1452
|
+
upgradeGift(args: {
|
|
1453
|
+
/** Unique identifier of the business connection */
|
|
1454
|
+
business_connection_id: string;
|
|
1455
|
+
/** Unique identifier of the regular gift that should be upgraded to a unique one */
|
|
1456
|
+
owned_gift_id: string;
|
|
1457
|
+
/** Pass True to keep the original gift text, sender and receiver in the upgraded gift */
|
|
1458
|
+
keep_original_details?: boolean;
|
|
1459
|
+
/** The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed. */
|
|
1460
|
+
star_count?: number;
|
|
1461
|
+
}): true;
|
|
1462
|
+
/** Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success. */
|
|
1463
|
+
transferGift(args: {
|
|
1464
|
+
/** Unique identifier of the business connection */
|
|
1465
|
+
business_connection_id: string;
|
|
1466
|
+
/** Unique identifier of the regular gift that should be transferred */
|
|
1467
|
+
owned_gift_id: string;
|
|
1468
|
+
/** Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours. */
|
|
1469
|
+
new_owner_chat_id: number;
|
|
1470
|
+
/** The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required. */
|
|
1471
|
+
star_count: number;
|
|
1472
|
+
}): true;
|
|
1473
|
+
/** Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
|
|
1474
|
+
postStory(args: {
|
|
1475
|
+
/** Unique identifier of the business connection */
|
|
1476
|
+
business_connection_id: string;
|
|
1477
|
+
/** Content of the story */
|
|
1478
|
+
content: InputStoryContent<F>;
|
|
1479
|
+
/** Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 */
|
|
1480
|
+
active_period: number;
|
|
1481
|
+
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1482
|
+
caption?: string;
|
|
1483
|
+
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1484
|
+
parse_mode?: ParseMode;
|
|
1485
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1486
|
+
caption_entities?: MessageEntity[];
|
|
1487
|
+
/** A list of clickable areas to be shown on the story */
|
|
1488
|
+
areas?: StoryArea[];
|
|
1489
|
+
/** Pass True to keep the story accessible after it expires */
|
|
1490
|
+
post_to_chat_page?: boolean;
|
|
1491
|
+
/** Pass True if the content of the story must be protected from forwarding and screenshotting */
|
|
1492
|
+
protect_content?: boolean;
|
|
1493
|
+
}): Story;
|
|
1494
|
+
/** Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
|
|
1495
|
+
editStory(args: {
|
|
1496
|
+
/** Unique identifier of the business connection */
|
|
1497
|
+
business_connection_id: string;
|
|
1498
|
+
/** Unique identifier of the story to edit */
|
|
1499
|
+
story_id: number;
|
|
1500
|
+
/** Content of the story */
|
|
1501
|
+
content: InputStoryContent<F>;
|
|
1502
|
+
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1503
|
+
caption?: string;
|
|
1504
|
+
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1505
|
+
parse_mode?: ParseMode;
|
|
1506
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1507
|
+
caption_entities?: MessageEntity[];
|
|
1508
|
+
/** A list of clickable areas to be shown on the story */
|
|
1509
|
+
areas?: StoryArea;
|
|
1510
|
+
}): Story;
|
|
1511
|
+
/** Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success. */
|
|
1512
|
+
deleteStory(args: {
|
|
1513
|
+
/** Unique identifier of the business connection */
|
|
1514
|
+
business_connection_id: string;
|
|
1515
|
+
/** Unique identifier of the story to delete */
|
|
1516
|
+
story_id: number;
|
|
1517
|
+
}): true;
|
|
1347
1518
|
/** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
|
|
1348
1519
|
sendSticker(args: {
|
|
1349
1520
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
@@ -1488,23 +1659,40 @@ export type ApiMethods<F> = {
|
|
|
1488
1659
|
/** Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail. */
|
|
1489
1660
|
custom_emoji_id?: string;
|
|
1490
1661
|
}): true;
|
|
1491
|
-
/** Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object. */
|
|
1662
|
+
/** Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object. */
|
|
1492
1663
|
getAvailableGifts(): Gifts;
|
|
1493
|
-
/** Sends a gift to the given user. The gift can't be converted to Telegram Stars by the
|
|
1664
|
+
/** 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. */
|
|
1494
1665
|
sendGift(args: {
|
|
1495
|
-
/** Unique identifier of the target user
|
|
1496
|
-
user_id
|
|
1666
|
+
/** Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. */
|
|
1667
|
+
user_id?: number;
|
|
1668
|
+
/** 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. */
|
|
1669
|
+
chat_id?: number | string;
|
|
1497
1670
|
/** Identifier of the gift */
|
|
1498
1671
|
gift_id: string;
|
|
1499
1672
|
/** Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver */
|
|
1500
1673
|
pay_for_upgrade?: boolean;
|
|
1501
|
-
/** Text that will be shown along with the gift; 0-
|
|
1674
|
+
/** Text that will be shown along with the gift; 0-128 characters */
|
|
1502
1675
|
text?: string;
|
|
1503
1676
|
/** 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. */
|
|
1504
1677
|
text_parse_mode?: ParseMode;
|
|
1505
1678
|
/** A list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
|
|
1506
1679
|
text_entities?: MessageEntity[];
|
|
1507
1680
|
}): Gifts;
|
|
1681
|
+
/** Gifts a Telegram Premium subscription to the given user. Returns True on success. */
|
|
1682
|
+
giftPremiumSubscription(args: {
|
|
1683
|
+
/** Unique identifier of the target user who will receive a Telegram Premium subscription */
|
|
1684
|
+
user_id: number;
|
|
1685
|
+
/** Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 */
|
|
1686
|
+
month_count: 3 | 6 | 12;
|
|
1687
|
+
/** Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months */
|
|
1688
|
+
star_count: 1000 | 1500 | 2500;
|
|
1689
|
+
/** Text that will be shown along with the service message about the subscription; 0-128 characters */
|
|
1690
|
+
text?: string;
|
|
1691
|
+
/** 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. */
|
|
1692
|
+
text_parse_mode?: ParseMode;
|
|
1693
|
+
/** A list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. */
|
|
1694
|
+
text_entities?: MessageEntity[];
|
|
1695
|
+
}): true;
|
|
1508
1696
|
/** Use this method to send answers to an inline query. On success, True is returned.
|
|
1509
1697
|
No more than 50 results per query are allowed.
|
|
1510
1698
|
|
|
@@ -1663,7 +1851,7 @@ export type ApiMethods<F> = {
|
|
|
1663
1851
|
ok: boolean;
|
|
1664
1852
|
/** Required if ok is True. An array of available shipping options. */
|
|
1665
1853
|
shipping_options?: readonly ShippingOption[];
|
|
1666
|
-
/** Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g.
|
|
1854
|
+
/** 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. */
|
|
1667
1855
|
error_message?: string;
|
|
1668
1856
|
}): true;
|
|
1669
1857
|
/** Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. */
|
|
@@ -1722,6 +1910,15 @@ export type ApiMethods<F> = {
|
|
|
1722
1910
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1723
1911
|
chat_id: number | string;
|
|
1724
1912
|
}): true;
|
|
1913
|
+
/** Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. */
|
|
1914
|
+
readBusinessMessage(args: {
|
|
1915
|
+
/** Unique identifier of the business connection on behalf of which to read the message */
|
|
1916
|
+
business_connection_id: string;
|
|
1917
|
+
/** Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. */
|
|
1918
|
+
chat_id: number;
|
|
1919
|
+
/** Unique identifier of the message to mark as read */
|
|
1920
|
+
message_id: number;
|
|
1921
|
+
}): true;
|
|
1725
1922
|
/** 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.
|
|
1726
1923
|
|
|
1727
1924
|
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. */
|
|
@@ -1832,6 +2029,10 @@ export interface InputMediaVideo<F> {
|
|
|
1832
2029
|
media: F | string;
|
|
1833
2030
|
/** 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>. */
|
|
1834
2031
|
thumbnail?: F;
|
|
2032
|
+
/** 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. */
|
|
2033
|
+
cover?: F | string;
|
|
2034
|
+
/** Start timestamp for the video in the message */
|
|
2035
|
+
start_timestamp?: number;
|
|
1835
2036
|
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
1836
2037
|
caption?: string;
|
|
1837
2038
|
/** Pass True, if the caption must be shown above the message media */
|
|
@@ -1934,6 +2135,10 @@ export interface InputPaidMediaVideo<F> {
|
|
|
1934
2135
|
media: F | string;
|
|
1935
2136
|
/** 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 » */
|
|
1936
2137
|
thumbnail?: F | string;
|
|
2138
|
+
/** 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. */
|
|
2139
|
+
cover?: F | string;
|
|
2140
|
+
/** Start timestamp for the video in the message */
|
|
2141
|
+
start_timestamp?: number;
|
|
1937
2142
|
/** Video width */
|
|
1938
2143
|
width?: number;
|
|
1939
2144
|
/** Video height */
|
|
@@ -1943,4 +2148,50 @@ export interface InputPaidMediaVideo<F> {
|
|
|
1943
2148
|
/** Pass True if the uploaded video is suitable for streaming */
|
|
1944
2149
|
supports_streaming?: boolean;
|
|
1945
2150
|
}
|
|
2151
|
+
/** This object describes a profile photo to set. Currently, it can be one of
|
|
2152
|
+
|
|
2153
|
+
- InputProfilePhotoStatic
|
|
2154
|
+
- InputProfilePhotoAnimated */
|
|
2155
|
+
export type InputProfilePhoto<F> = InputProfilePhotoStatic<F> | InputProfilePhotoAnimated<F>;
|
|
2156
|
+
/** A static profile photo in the .JPG format. */
|
|
2157
|
+
export interface InputProfilePhotoStatic<F> {
|
|
2158
|
+
/** Type of the profile photo, must be “static” */
|
|
2159
|
+
type: "static";
|
|
2160
|
+
/** The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2161
|
+
photo: F;
|
|
2162
|
+
}
|
|
2163
|
+
/** An animated profile photo in the MPEG4 format. */
|
|
2164
|
+
export interface InputProfilePhotoAnimated<F> {
|
|
2165
|
+
/** Type of the profile photo, must be “animated” */
|
|
2166
|
+
type: "animated";
|
|
2167
|
+
/** The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2168
|
+
animation: F;
|
|
2169
|
+
/** Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0. */
|
|
2170
|
+
main_frame_timestamp?: number;
|
|
2171
|
+
}
|
|
2172
|
+
/** This object describes the content of a story to post. Currently, it can be one of
|
|
2173
|
+
|
|
2174
|
+
- InputStoryContentPhoto
|
|
2175
|
+
- InputStoryContentVideo */
|
|
2176
|
+
export type InputStoryContent<F> = InputStoryContentPhoto<F> | InputStoryContentVideo<F>;
|
|
2177
|
+
/** Describes a photo to post as a story. */
|
|
2178
|
+
export interface InputStoryContentPhoto<F> {
|
|
2179
|
+
/** Type of the content, must be “photo” */
|
|
2180
|
+
type: "photo";
|
|
2181
|
+
/** The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2182
|
+
photo: F;
|
|
2183
|
+
}
|
|
2184
|
+
/** Describes a video to post as a story. */
|
|
2185
|
+
export interface InputStoryContentVideo<F> {
|
|
2186
|
+
/** Type of the content, must be “video” */
|
|
2187
|
+
type: "video";
|
|
2188
|
+
/** The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the video was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files » */
|
|
2189
|
+
video: F;
|
|
2190
|
+
/** Precise duration of the video in seconds; 0-60 */
|
|
2191
|
+
duration?: number;
|
|
2192
|
+
/** Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0. */
|
|
2193
|
+
cover_frame_timestamp?: number;
|
|
2194
|
+
/** Pass True if the video has no sound */
|
|
2195
|
+
is_animation?: boolean;
|
|
2196
|
+
}
|
|
1946
2197
|
export {};
|
package/mod.d.ts
CHANGED
package/package.json
CHANGED
package/payment.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Chat, User } from "./manage.js";
|
|
2
|
-
import type { PaidMedia, Sticker } from "./message.js";
|
|
2
|
+
import type { MessageEntity, PaidMedia, Sticker } from "./message.js";
|
|
3
3
|
/** This object represents a portion of the price for goods or services. */
|
|
4
4
|
export interface LabeledPrice {
|
|
5
5
|
/** Portion label */
|
|
@@ -55,7 +55,7 @@ export interface ShippingOption {
|
|
|
55
55
|
/** List of price portions */
|
|
56
56
|
prices: LabeledPrice[];
|
|
57
57
|
}
|
|
58
|
-
/** This object contains basic information about a successful payment. */
|
|
58
|
+
/** This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control. */
|
|
59
59
|
export interface SuccessfulPayment {
|
|
60
60
|
/** Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */
|
|
61
61
|
currency: string;
|
|
@@ -160,30 +160,44 @@ export interface AffiliateInfo {
|
|
|
160
160
|
/** This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
|
|
161
161
|
|
|
162
162
|
- TransactionPartnerUser
|
|
163
|
+
- TransactionPartnerChat
|
|
163
164
|
- TransactionPartnerAffiliateProgram
|
|
164
165
|
- TransactionPartnerFragment
|
|
165
166
|
- TransactionPartnerTelegramAds
|
|
166
167
|
- TransactionPartnerTelegramApi
|
|
167
168
|
- TransactionPartnerOther */
|
|
168
|
-
export type TransactionPartner = TransactionPartnerUser | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;
|
|
169
|
+
export type TransactionPartner = TransactionPartnerUser | TransactionPartnerChat | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther;
|
|
169
170
|
/** Describes a transaction with a user. */
|
|
170
171
|
export interface TransactionPartnerUser {
|
|
171
172
|
/** Type of the transaction partner, always “user” */
|
|
172
173
|
type: "user";
|
|
174
|
+
/** Type of the transaction, currently one of “invoice_payment” for payments via invoices, “paid_media_payment” for payments for paid media, “gift_purchase” for gifts sent by the bot, “premium_purchase” for Telegram Premium subscriptions gifted by the bot, “business_account_transfer” for direct transfers from managed business accounts */
|
|
175
|
+
transaction_type: "invoice_payment" | "paid_media_payment" | "gift_purchase" | "premium_purchase" | "business_account_transfer";
|
|
173
176
|
/** Information about the user */
|
|
174
177
|
user: User;
|
|
175
|
-
/** Information about the affiliate that received a commission via this transaction */
|
|
178
|
+
/** Information about the affiliate that received a commission via this transaction. Can be available only for “invoice_payment” and “paid_media_payment” transactions. */
|
|
176
179
|
affiliate?: AffiliateInfo;
|
|
177
|
-
/** Bot-specified invoice payload */
|
|
180
|
+
/** Bot-specified invoice payload. Can be available only for “invoice_payment” transactions. */
|
|
178
181
|
invoice_payload?: string;
|
|
179
|
-
/** The duration of the paid subscription */
|
|
182
|
+
/** The duration of the paid subscription. Can be available only for “invoice_payment” transactions. */
|
|
180
183
|
subscription_period?: number;
|
|
181
|
-
/** Information about the paid media bought by the user */
|
|
184
|
+
/** Information about the paid media bought by the user; for “paid_media_payment” transactions only */
|
|
182
185
|
paid_media?: PaidMedia[];
|
|
183
|
-
/** Bot-specified paid media payload */
|
|
186
|
+
/** Bot-specified paid media payload. Can be available only for “paid_media_payment” transactions. */
|
|
184
187
|
paid_media_payload?: string;
|
|
185
|
-
/** The gift sent to the user by the bot */
|
|
186
|
-
gift?:
|
|
188
|
+
/** The gift sent to the user by the bot; for “gift_purchase” transactions only */
|
|
189
|
+
gift?: Gift;
|
|
190
|
+
/** Number of months the gifted Telegram Premium subscription will be active for; for “premium_purchase” transactions only */
|
|
191
|
+
premium_subscription_duration?: number;
|
|
192
|
+
}
|
|
193
|
+
/** Describes a transaction with a chat. */
|
|
194
|
+
export interface TransactionPartnerChat {
|
|
195
|
+
/** Type of the transaction partner, always “chat” */
|
|
196
|
+
type: "chat";
|
|
197
|
+
/** Information about the chat */
|
|
198
|
+
chat: Chat;
|
|
199
|
+
/** The gift sent to the chat by the bot */
|
|
200
|
+
gift?: Gift;
|
|
187
201
|
}
|
|
188
202
|
/** Describes the affiliate program that issued the affiliate commission received via this transaction. */
|
|
189
203
|
export interface TransactionPartnerAffiliateProgram {
|
|
@@ -218,7 +232,7 @@ export interface TransactionPartnerOther {
|
|
|
218
232
|
/** Type of the transaction partner, always “other” */
|
|
219
233
|
type: "other";
|
|
220
234
|
}
|
|
221
|
-
/** Describes a Telegram Star transaction. */
|
|
235
|
+
/** Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control. */
|
|
222
236
|
export interface StarTransaction {
|
|
223
237
|
/** Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. */
|
|
224
238
|
id: string;
|
|
@@ -265,3 +279,160 @@ export interface Gifts {
|
|
|
265
279
|
/** The list of gifts */
|
|
266
280
|
gifts: Gift[];
|
|
267
281
|
}
|
|
282
|
+
/** This object describes the model of a unique gift. */
|
|
283
|
+
export interface UniqueGiftModel {
|
|
284
|
+
/** Name of the model */
|
|
285
|
+
name: string;
|
|
286
|
+
/** The sticker that represents the unique gift */
|
|
287
|
+
sticker: Sticker;
|
|
288
|
+
/** The number of unique gifts that receive this model for every 1000 gifts upgraded */
|
|
289
|
+
rarity_per_mille: number;
|
|
290
|
+
}
|
|
291
|
+
/** This object describes the symbol shown on the pattern of a unique gift. */
|
|
292
|
+
export interface UniqueGiftSymbol {
|
|
293
|
+
/** Name of the symbol */
|
|
294
|
+
name: string;
|
|
295
|
+
/** The sticker that represents the unique gift */
|
|
296
|
+
sticker: Sticker;
|
|
297
|
+
/** The number of unique gifts that receive this model for every 1000 gifts upgraded */
|
|
298
|
+
rarity_per_mille: number;
|
|
299
|
+
}
|
|
300
|
+
/** This object describes the colors of the backdrop of a unique gift. */
|
|
301
|
+
export interface UniqueGiftBackdropColors {
|
|
302
|
+
/** The color in the center of the backdrop in RGB format */
|
|
303
|
+
center_color: number;
|
|
304
|
+
/** The color on the edges of the backdrop in RGB format */
|
|
305
|
+
edge_color: number;
|
|
306
|
+
/** The color to be applied to the symbol in RGB format */
|
|
307
|
+
symbol_color: number;
|
|
308
|
+
/** The color for the text on the backdrop in RGB format */
|
|
309
|
+
text_color: number;
|
|
310
|
+
}
|
|
311
|
+
/** This object describes the backdrop of a unique gift. */
|
|
312
|
+
export interface UniqueGiftBackdrop {
|
|
313
|
+
/** Name of the backdrop */
|
|
314
|
+
name: string;
|
|
315
|
+
/** Colors of the backdrop */
|
|
316
|
+
colors: UniqueGiftBackdropColors;
|
|
317
|
+
/** The number of unique gifts that receive this backdrop for every 1000 gifts upgraded */
|
|
318
|
+
rarity_per_mille: number;
|
|
319
|
+
}
|
|
320
|
+
/** This object describes a unique gift that was upgraded from a regular gift. */
|
|
321
|
+
export interface UniqueGift {
|
|
322
|
+
/** Human-readable name of the regular gift from which this unique gift was upgraded */
|
|
323
|
+
base_name: string;
|
|
324
|
+
/** Unique name of the gift. This name can be used in https://t.me/nft/... links and story areas */
|
|
325
|
+
name: string;
|
|
326
|
+
/** Unique number of the upgraded gift among gifts upgraded from the same regular gift */
|
|
327
|
+
number: number;
|
|
328
|
+
/** Model of the gift */
|
|
329
|
+
model: UniqueGiftModel;
|
|
330
|
+
/** Symbol of the gift */
|
|
331
|
+
symbol: UniqueGiftSymbol;
|
|
332
|
+
/** Backdrop of the gift */
|
|
333
|
+
backdrop: UniqueGiftBackdrop;
|
|
334
|
+
}
|
|
335
|
+
/** Describes a service message about a regular gift that was sent or received. */
|
|
336
|
+
export interface GiftInfo {
|
|
337
|
+
/** Information about the gift */
|
|
338
|
+
gift: Gift;
|
|
339
|
+
/** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
|
|
340
|
+
owned_gift_id?: string;
|
|
341
|
+
/** Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible */
|
|
342
|
+
convert_star_count?: number;
|
|
343
|
+
/** Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift */
|
|
344
|
+
prepaid_upgrade_star_count?: number;
|
|
345
|
+
/** True, if the gift can be upgraded to a unique gift */
|
|
346
|
+
can_be_upgraded?: true;
|
|
347
|
+
/** Text of the message that was added to the gift */
|
|
348
|
+
text?: string;
|
|
349
|
+
/** Special entities that appear in the text */
|
|
350
|
+
entities?: MessageEntity[];
|
|
351
|
+
/** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
|
|
352
|
+
is_private?: true;
|
|
353
|
+
}
|
|
354
|
+
/** Describes a service message about a unique gift that was sent or received. */
|
|
355
|
+
export interface UniqueGiftInfo {
|
|
356
|
+
/** Information about the gift */
|
|
357
|
+
gift: UniqueGift;
|
|
358
|
+
/** Origin of the gift. Currently, either “upgrade” or “transfer” */
|
|
359
|
+
origin: "upgrade" | "transfer";
|
|
360
|
+
/** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
|
|
361
|
+
owned_gift_id?: string;
|
|
362
|
+
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
|
|
363
|
+
transfer_star_count?: number;
|
|
364
|
+
}
|
|
365
|
+
/** Describes a service message about a change in the price of paid messages within a chat. */
|
|
366
|
+
export interface PaidMessagePriceChanged {
|
|
367
|
+
/** The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message */
|
|
368
|
+
paid_message_star_count: number;
|
|
369
|
+
}
|
|
370
|
+
/** Describes an amount of Telegram Stars. */
|
|
371
|
+
export interface StarAmount {
|
|
372
|
+
/** Integer amount of Telegram Stars, rounded to 0; can be negative */
|
|
373
|
+
amount: number;
|
|
374
|
+
/** The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive */
|
|
375
|
+
nanostar_amount?: number;
|
|
376
|
+
}
|
|
377
|
+
/** This object describes a gift received and owned by a user or a chat. Currently, it can be one of
|
|
378
|
+
|
|
379
|
+
- OwnedGiftRegular
|
|
380
|
+
- OwnedGiftUnique */
|
|
381
|
+
export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique;
|
|
382
|
+
/** Describes a regular gift owned by a user or a chat. */
|
|
383
|
+
export interface OwnedGiftRegular {
|
|
384
|
+
/** Type of the gift, always “regular” */
|
|
385
|
+
type: "regular";
|
|
386
|
+
/** Information about the regular gift */
|
|
387
|
+
gift: Gift;
|
|
388
|
+
/** Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only */
|
|
389
|
+
owned_gift_id?: string;
|
|
390
|
+
/** Sender of the gift if it is a known user */
|
|
391
|
+
sender_user?: User;
|
|
392
|
+
/** Date the gift was sent in Unix time */
|
|
393
|
+
send_date: number;
|
|
394
|
+
/** Text of the message that was added to the gift */
|
|
395
|
+
text?: string;
|
|
396
|
+
/** Special entities that appear in the text */
|
|
397
|
+
entities?: MessageEntity[];
|
|
398
|
+
/** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
|
|
399
|
+
is_private?: true;
|
|
400
|
+
/** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
|
|
401
|
+
is_saved?: true;
|
|
402
|
+
/** True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only */
|
|
403
|
+
can_be_upgraded?: true;
|
|
404
|
+
/** True, if the gift was refunded and isn't available anymore */
|
|
405
|
+
was_refunded?: true;
|
|
406
|
+
/** Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars */
|
|
407
|
+
convert_star_count?: number;
|
|
408
|
+
/** Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift */
|
|
409
|
+
prepaid_upgrade_star_count?: number;
|
|
410
|
+
}
|
|
411
|
+
/** Describes a unique gift received and owned by a user or a chat. */
|
|
412
|
+
export interface OwnedGiftUnique {
|
|
413
|
+
/** Type of the gift, always “unique” */
|
|
414
|
+
type: "unique";
|
|
415
|
+
/** Information about the unique gift */
|
|
416
|
+
gift: UniqueGift;
|
|
417
|
+
/** Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only */
|
|
418
|
+
owned_gift_id?: string;
|
|
419
|
+
/** Sender of the gift if it is a known user */
|
|
420
|
+
sender_user?: User;
|
|
421
|
+
/** Date the gift was sent in Unix time */
|
|
422
|
+
send_date: number;
|
|
423
|
+
/** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
|
|
424
|
+
is_saved?: true;
|
|
425
|
+
/** True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only */
|
|
426
|
+
can_be_transferred?: true;
|
|
427
|
+
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
|
|
428
|
+
transfer_star_count?: number;
|
|
429
|
+
}
|
|
430
|
+
/** Contains the list of gifts received and owned by a user or a chat. */
|
|
431
|
+
export interface OwnedGifts {
|
|
432
|
+
/** The total number of gifts owned by the user or the chat */
|
|
433
|
+
total_count: number;
|
|
434
|
+
/** The list of gifts */
|
|
435
|
+
gifts: OwnedGift[];
|
|
436
|
+
/** Offset for the next request. If empty, then there are no more results */
|
|
437
|
+
next_offset?: string;
|
|
438
|
+
}
|
package/story.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ReactionType } from "./message.js";
|
|
2
|
+
/** Describes the position of a clickable area within a story. */
|
|
3
|
+
export interface StoryAreaPosition {
|
|
4
|
+
/** The abscissa of the area's center, as a percentage of the media width */
|
|
5
|
+
x_percentage: number;
|
|
6
|
+
/** The ordinate of the area's center, as a percentage of the media height */
|
|
7
|
+
y_percentage: number;
|
|
8
|
+
/** The width of the area's rectangle, as a percentage of the media width */
|
|
9
|
+
width_percentage: number;
|
|
10
|
+
/** The height of the area's rectangle, as a percentage of the media height */
|
|
11
|
+
height_percentage: number;
|
|
12
|
+
/** The clockwise rotation angle of the rectangle, in degrees; 0-360 */
|
|
13
|
+
rotation_angle: number;
|
|
14
|
+
/** The radius of the rectangle corner rounding, as a percentage of the media width */
|
|
15
|
+
corner_radius_percentage: number;
|
|
16
|
+
}
|
|
17
|
+
/** Describes the physical address of a location. */
|
|
18
|
+
export interface LocationAddress {
|
|
19
|
+
/** The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located */
|
|
20
|
+
country_code: string;
|
|
21
|
+
/** State of the location */
|
|
22
|
+
state?: string;
|
|
23
|
+
/** City of the location */
|
|
24
|
+
city?: string;
|
|
25
|
+
/** Street address of the location */
|
|
26
|
+
street?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Describes the type of a clickable area on a story. Currently, it can be one of
|
|
29
|
+
|
|
30
|
+
- StoryAreaTypeLocation
|
|
31
|
+
- StoryAreaTypeSuggestedReaction
|
|
32
|
+
- StoryAreaTypeLink
|
|
33
|
+
- StoryAreaTypeWeather
|
|
34
|
+
- StoryAreaTypeUniqueGift */
|
|
35
|
+
export type StoryAreaType = StoryAreaTypeLocation | StoryAreaTypeSuggestedReaction | StoryAreaTypeLink | StoryAreaTypeWeather | StoryAreaTypeUniqueGift;
|
|
36
|
+
/** Describes a story area pointing to a location. Currently, a story can have up to 10 location areas. */
|
|
37
|
+
export interface StoryAreaTypeLocation {
|
|
38
|
+
/** Type of the area, always “location” */
|
|
39
|
+
type: "location";
|
|
40
|
+
/** Location latitude in degrees */
|
|
41
|
+
latitude: number;
|
|
42
|
+
/** Location longitude in degrees */
|
|
43
|
+
longitude: number;
|
|
44
|
+
/** Address of the location */
|
|
45
|
+
address?: LocationAddress;
|
|
46
|
+
}
|
|
47
|
+
/** Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas. */
|
|
48
|
+
export interface StoryAreaTypeSuggestedReaction {
|
|
49
|
+
/** Type of the area, always “suggested_reaction” */
|
|
50
|
+
type: "suggested_reaction";
|
|
51
|
+
/** Type of the reaction */
|
|
52
|
+
reaction_type: ReactionType;
|
|
53
|
+
/** Pass True if the reaction area has a dark background */
|
|
54
|
+
is_dark?: boolean;
|
|
55
|
+
/** Pass True if reaction area corner is flipped */
|
|
56
|
+
is_flipped?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas. */
|
|
59
|
+
export interface StoryAreaTypeLink {
|
|
60
|
+
/** Type of the area, always “link” */
|
|
61
|
+
type: "link";
|
|
62
|
+
/** HTTP or tg:// URL to be opened when the area is clicked */
|
|
63
|
+
url: string;
|
|
64
|
+
}
|
|
65
|
+
/** Describes a story area containing weather information. Currently, a story can have up to 3 weather areas. */
|
|
66
|
+
export interface StoryAreaTypeWeather {
|
|
67
|
+
/** Type of the area, always “weather” */
|
|
68
|
+
type: "weather";
|
|
69
|
+
/** Temperature, in degree Celsius */
|
|
70
|
+
temperature: number;
|
|
71
|
+
/** Emoji representing the weather */
|
|
72
|
+
emoji: string;
|
|
73
|
+
/** A color of the area background in the ARGB format */
|
|
74
|
+
background_color: number;
|
|
75
|
+
}
|
|
76
|
+
/** Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area. */
|
|
77
|
+
export interface StoryAreaTypeUniqueGift {
|
|
78
|
+
/** Type of the area, always “unique_gift” */
|
|
79
|
+
type: "unique_gift";
|
|
80
|
+
/** Unique name of the gift */
|
|
81
|
+
name: string;
|
|
82
|
+
}
|
|
83
|
+
/** Describes a clickable area on a story media. */
|
|
84
|
+
export interface StoryArea {
|
|
85
|
+
/** Position of the area */
|
|
86
|
+
position: StoryAreaPosition;
|
|
87
|
+
/** Type of the area */
|
|
88
|
+
type: StoryAreaType;
|
|
89
|
+
}
|