@grammyjs/types 3.19.0 → 3.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/checklist.d.ts +70 -0
- package/manage.d.ts +52 -10
- package/message.d.ts +34 -1
- package/methods.d.ts +275 -7
- package/mod.d.ts +2 -0
- package/package.json +1 -1
- package/payment.d.ts +174 -7
- package/story.d.ts +89 -0
package/checklist.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { User } from "./manage.js";
|
|
2
|
+
import type { Message, MessageEntity, ParseMode } from "./message.js";
|
|
3
|
+
/** Describes a task in a checklist. */
|
|
4
|
+
export interface ChecklistTask {
|
|
5
|
+
/** Unique identifier of the task */
|
|
6
|
+
id: number;
|
|
7
|
+
/** Text of the task */
|
|
8
|
+
text: string;
|
|
9
|
+
/** Special entities that appear in the task text */
|
|
10
|
+
text_entities?: MessageEntity[];
|
|
11
|
+
/** User that completed the task; omitted if the task wasn't completed */
|
|
12
|
+
completed_by_user?: User;
|
|
13
|
+
/** Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed */
|
|
14
|
+
completion_date?: number;
|
|
15
|
+
}
|
|
16
|
+
/** Describes a checklist. */
|
|
17
|
+
export interface Checklist {
|
|
18
|
+
/** Title of the checklist */
|
|
19
|
+
title: string;
|
|
20
|
+
/** Special entities that appear in the checklist title */
|
|
21
|
+
title_entities?: MessageEntity[];
|
|
22
|
+
/** List of tasks in the checklist */
|
|
23
|
+
tasks: ChecklistTask[];
|
|
24
|
+
/** True, if users other than the creator of the list can add tasks to the list */
|
|
25
|
+
others_can_add_tasks?: true;
|
|
26
|
+
/** True, if users other than the creator of the list can mark tasks as done or not done */
|
|
27
|
+
others_can_mark_tasks_as_done?: true;
|
|
28
|
+
}
|
|
29
|
+
/** Describes a task to add to a checklist. */
|
|
30
|
+
export interface InputChecklistTask {
|
|
31
|
+
/** Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist */
|
|
32
|
+
id: number;
|
|
33
|
+
/** Text of the task; 1-100 characters after entities parsing */
|
|
34
|
+
text: string;
|
|
35
|
+
/** Mode for parsing entities in the text. See formatting options for more details. */
|
|
36
|
+
parse_mode?: string;
|
|
37
|
+
/** List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed. */
|
|
38
|
+
text_entities?: MessageEntity[];
|
|
39
|
+
}
|
|
40
|
+
/** Describes a checklist to create. */
|
|
41
|
+
export interface InputChecklist {
|
|
42
|
+
/** Title of the checklist; 1-255 characters after entities parsing */
|
|
43
|
+
title: string;
|
|
44
|
+
/** Mode for parsing entities in the title. See formatting options for more details. */
|
|
45
|
+
parse_mode?: ParseMode;
|
|
46
|
+
/** List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed. */
|
|
47
|
+
title_entities?: MessageEntity[];
|
|
48
|
+
/** List of 1-30 tasks in the checklist */
|
|
49
|
+
tasks: InputChecklistTask[];
|
|
50
|
+
/** Pass True if other users can add tasks to the checklist */
|
|
51
|
+
others_can_add_tasks?: boolean;
|
|
52
|
+
/** Pass True if other users can mark tasks as done or not done in the checklist */
|
|
53
|
+
others_can_mark_tasks_as_done?: true;
|
|
54
|
+
}
|
|
55
|
+
/** Describes a service message about checklist tasks marked as done or not done. */
|
|
56
|
+
export interface ChecklistTasksDone {
|
|
57
|
+
/** Message containing the checklist whose tasks were marked as done or not done. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
|
|
58
|
+
checklist_message?: Message;
|
|
59
|
+
/** Identifiers of the tasks that were marked as done */
|
|
60
|
+
marked_as_done_task_ids?: number[];
|
|
61
|
+
/** Identifiers of the tasks that were marked as not done */
|
|
62
|
+
marked_as_not_done_task_ids?: number[];
|
|
63
|
+
}
|
|
64
|
+
/** Describes a service message about tasks added to a checklist. */
|
|
65
|
+
export interface ChecklistTasksAdded {
|
|
66
|
+
/** Message containing the checklist to which the tasks were added. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */
|
|
67
|
+
checklist_message?: Message;
|
|
68
|
+
/** List of tasks added to the checklist */
|
|
69
|
+
tasks: ChecklistTask[];
|
|
70
|
+
}
|
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,8 +203,8 @@ export declare namespace ChatFullInfo {
|
|
|
192
203
|
pinned_message?: Message;
|
|
193
204
|
/** Default chat member permissions, for groups and supergroups */
|
|
194
205
|
permissions?: undefined;
|
|
195
|
-
/**
|
|
196
|
-
|
|
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;
|
|
197
208
|
/** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
198
209
|
can_send_paid_media?: undefined;
|
|
199
210
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
@@ -552,7 +563,7 @@ export interface ChatInviteLink {
|
|
|
552
563
|
export interface ChatAdministratorRights {
|
|
553
564
|
/** True, if the user's presence in the chat is hidden */
|
|
554
565
|
is_anonymous: boolean;
|
|
555
|
-
/** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages
|
|
566
|
+
/** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
|
|
556
567
|
can_manage_chat: boolean;
|
|
557
568
|
/** True, if the administrator can delete messages of other users */
|
|
558
569
|
can_delete_messages: boolean;
|
|
@@ -572,7 +583,7 @@ export interface ChatAdministratorRights {
|
|
|
572
583
|
can_edit_stories: boolean;
|
|
573
584
|
/** True, if the administrator can delete stories posted by other users */
|
|
574
585
|
can_delete_stories: boolean;
|
|
575
|
-
/** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
|
|
586
|
+
/** True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
|
|
576
587
|
can_post_messages?: boolean;
|
|
577
588
|
/** True, if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
578
589
|
can_edit_messages?: boolean;
|
|
@@ -629,7 +640,7 @@ export interface ChatMemberAdministrator {
|
|
|
629
640
|
can_be_edited: boolean;
|
|
630
641
|
/** True, if the user's presence in the chat is hidden */
|
|
631
642
|
is_anonymous: boolean;
|
|
632
|
-
/** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages
|
|
643
|
+
/** True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
|
|
633
644
|
can_manage_chat: boolean;
|
|
634
645
|
/** True, if the administrator can delete messages of other users */
|
|
635
646
|
can_delete_messages: boolean;
|
|
@@ -649,7 +660,7 @@ export interface ChatMemberAdministrator {
|
|
|
649
660
|
can_edit_stories: boolean;
|
|
650
661
|
/** True, if the administrator can delete stories posted by other users */
|
|
651
662
|
can_delete_stories: boolean;
|
|
652
|
-
/** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
|
|
663
|
+
/** True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
|
|
653
664
|
can_post_messages?: boolean;
|
|
654
665
|
/** True, if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
655
666
|
can_edit_messages?: boolean;
|
|
@@ -691,7 +702,7 @@ export interface ChatMemberRestricted {
|
|
|
691
702
|
can_send_video_notes: boolean;
|
|
692
703
|
/** True, if the user is allowed to send voice notes */
|
|
693
704
|
can_send_voice_notes: boolean;
|
|
694
|
-
/** True, if the user is allowed to send polls */
|
|
705
|
+
/** True, if the user is allowed to send polls and checklists */
|
|
695
706
|
can_send_polls: boolean;
|
|
696
707
|
/** True, if the user is allowed to send animations, games, stickers and use inline bots */
|
|
697
708
|
can_send_other_messages: boolean;
|
|
@@ -755,7 +766,7 @@ export interface ChatPermissions {
|
|
|
755
766
|
can_send_video_notes?: boolean;
|
|
756
767
|
/** True, if the user is allowed to send voice notes */
|
|
757
768
|
can_send_voice_notes?: boolean;
|
|
758
|
-
/** True, if the user is allowed to send polls */
|
|
769
|
+
/** True, if the user is allowed to send polls and checklists */
|
|
759
770
|
can_send_polls?: boolean;
|
|
760
771
|
/** True, if the user is allowed to send animations, games, stickers and use inline bots */
|
|
761
772
|
can_send_other_messages?: boolean;
|
|
@@ -901,6 +912,37 @@ export interface UserChatBoosts {
|
|
|
901
912
|
/** The list of boosts added to the chat by the user */
|
|
902
913
|
boosts: ChatBoost[];
|
|
903
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
|
+
}
|
|
904
946
|
/** Describes the connection of the bot with a business account. */
|
|
905
947
|
export interface BusinessConnection {
|
|
906
948
|
/** Unique identifier of the business connection */
|
|
@@ -911,8 +953,8 @@ export interface BusinessConnection {
|
|
|
911
953
|
user_chat_id: number;
|
|
912
954
|
/** Date the connection was established in Unix time */
|
|
913
955
|
date: number;
|
|
914
|
-
/**
|
|
915
|
-
|
|
956
|
+
/** Rights of the business bot */
|
|
957
|
+
rights?: BusinessBotRights;
|
|
916
958
|
/** True, if the connection is active */
|
|
917
959
|
is_enabled: boolean;
|
|
918
960
|
}
|
package/message.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { Checklist, ChecklistTasksAdded, ChecklistTasksDone } from "./checklist.js";
|
|
1
2
|
import type { Chat, User } from "./manage.js";
|
|
2
3
|
import type { InlineKeyboardMarkup } from "./markup.js";
|
|
3
4
|
import type { PassportData } from "./passport.js";
|
|
4
|
-
import type { Invoice, RefundedPayment, SuccessfulPayment } from "./payment.js";
|
|
5
|
+
import type { GiftInfo, Invoice, PaidMessagePriceChanged, RefundedPayment, SuccessfulPayment, UniqueGiftInfo } from "./payment.js";
|
|
5
6
|
type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
|
|
6
7
|
export declare namespace Message {
|
|
7
8
|
interface ServiceMessage {
|
|
@@ -55,6 +56,8 @@ export declare namespace Message {
|
|
|
55
56
|
link_preview_options?: LinkPreviewOptions;
|
|
56
57
|
/** Unique identifier of the message effect added to the message */
|
|
57
58
|
effect_id?: string;
|
|
59
|
+
/** The number of Telegram Stars that were paid by the sender of the message to send it */
|
|
60
|
+
paid_star_count?: number;
|
|
58
61
|
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
|
|
59
62
|
reply_markup?: InlineKeyboardMarkup;
|
|
60
63
|
}
|
|
@@ -87,6 +90,10 @@ export declare namespace Message {
|
|
|
87
90
|
type VenueMessage = LocationMessage & MsgWith<"venue">;
|
|
88
91
|
type LocationMessage = CommonMessage & MsgWith<"location">;
|
|
89
92
|
type PaidMediaMessage = CommonMessage & MsgWith<"paid_media">;
|
|
93
|
+
type DirectMessagePriceChangedMessage = ServiceMessage & MsgWith<"direct_message_price_changed">;
|
|
94
|
+
type ChecklistMessage = CommonMessage & MsgWith<"checklist">;
|
|
95
|
+
type ChecklistTasksDoneMessage = ServiceMessage & MsgWith<"checklist_tasks_done">;
|
|
96
|
+
type ChecklistTasksAddedMessage = ServiceMessage & MsgWith<"checklist_tasks_added">;
|
|
90
97
|
type NewChatMembersMessage = ServiceMessage & MsgWith<"new_chat_members">;
|
|
91
98
|
type LeftChatMemberMessage = ServiceMessage & MsgWith<"left_chat_member">;
|
|
92
99
|
type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">;
|
|
@@ -120,6 +127,9 @@ export declare namespace Message {
|
|
|
120
127
|
type GiveawayMessage = ServiceMessage & MsgWith<"giveaway">;
|
|
121
128
|
type GiveawayWinnersMessage = ServiceMessage & MsgWith<"giveaway_winners">;
|
|
122
129
|
type GiveawayCompletedMessage = ServiceMessage & MsgWith<"giveaway_completed">;
|
|
130
|
+
type GiftMessage = ServiceMessage & MsgWith<"gift">;
|
|
131
|
+
type UniqueGiftMessage = ServiceMessage & MsgWith<"unique_gift">;
|
|
132
|
+
type PaidMessagePriceChangedMessage = ServiceMessage & MsgWith<"paid_message_price_changed">;
|
|
123
133
|
type VideoChatScheduledMessage = ServiceMessage & MsgWith<"video_chat_scheduled">;
|
|
124
134
|
type VideoChatStartedMessage = ServiceMessage & MsgWith<"video_chat_started">;
|
|
125
135
|
type VideoChatEndedMessage = ServiceMessage & MsgWith<"video_chat_ended">;
|
|
@@ -167,6 +177,12 @@ export interface Message extends Message.MediaMessage {
|
|
|
167
177
|
location?: Location;
|
|
168
178
|
/** Message contains paid media; information about the paid media */
|
|
169
179
|
paid_media?: PaidMediaInfo;
|
|
180
|
+
/** Message is a checklist */
|
|
181
|
+
checklist?: Checklist;
|
|
182
|
+
/** Service message: some tasks in a checklist were marked as done or not done */
|
|
183
|
+
checklist_tasks_done?: ChecklistTasksDone;
|
|
184
|
+
/** Service message: tasks were added to a checklist */
|
|
185
|
+
checklist_tasks_added?: ChecklistTasksAdded;
|
|
170
186
|
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
|
|
171
187
|
new_chat_members?: User[];
|
|
172
188
|
/** A member was removed from the group, information about them (this member may be the bot itself) */
|
|
@@ -232,6 +248,14 @@ export interface Message extends Message.MediaMessage {
|
|
|
232
248
|
giveaway_winners?: GiveawayWinners;
|
|
233
249
|
/** Service message: a giveaway without public winners was completed */
|
|
234
250
|
giveaway_completed?: GiveawayCompleted;
|
|
251
|
+
/** Service message: a regular gift was sent or received */
|
|
252
|
+
gift?: GiftInfo;
|
|
253
|
+
/** Service message: a unique gift was sent or received */
|
|
254
|
+
unique_gift?: UniqueGiftInfo;
|
|
255
|
+
/** Service message: the price for paid messages has changed in the chat */
|
|
256
|
+
paid_message_price_changed?: PaidMessagePriceChanged;
|
|
257
|
+
/** Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed */
|
|
258
|
+
direct_message_price_changed?: DirectMessagePriceChanged;
|
|
235
259
|
/** Service message: video chat scheduled */
|
|
236
260
|
video_chat_scheduled?: VideoChatScheduled;
|
|
237
261
|
/** Service message: video chat started */
|
|
@@ -473,6 +497,8 @@ export interface ExternalReplyInfo {
|
|
|
473
497
|
paid_media?: PaidMediaInfo;
|
|
474
498
|
/** Message is a native poll, information about the poll */
|
|
475
499
|
poll?: Poll;
|
|
500
|
+
/** Message is a checklist */
|
|
501
|
+
checklist?: Checklist;
|
|
476
502
|
/** Message is a venue, information about the venue */
|
|
477
503
|
venue?: Venue;
|
|
478
504
|
}
|
|
@@ -1006,6 +1032,13 @@ export interface WriteAccessAllowed {
|
|
|
1006
1032
|
/** True, if the access was granted when the bot was added to the attachment or side menu */
|
|
1007
1033
|
from_attachment_menu?: boolean;
|
|
1008
1034
|
}
|
|
1035
|
+
/** Describes a service message about a change in the price of direct messages sent to a channel chat. */
|
|
1036
|
+
export interface DirectMessagePriceChanged {
|
|
1037
|
+
/** True, if direct messages are enabled for the channel chat; false otherwise */
|
|
1038
|
+
are_direct_messages_enabled: boolean;
|
|
1039
|
+
/** The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Defaults to 0. */
|
|
1040
|
+
direct_message_star_count?: number;
|
|
1041
|
+
}
|
|
1009
1042
|
/** This object represents a service message about a video chat scheduled in the chat. */
|
|
1010
1043
|
export interface VideoChatScheduled {
|
|
1011
1044
|
/** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
|
package/methods.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { InputChecklist } from "./checklist.js";
|
|
1
2
|
import type { InlineQueryResult, InlineQueryResultsButton } from "./inline.js";
|
|
2
3
|
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";
|
|
4
|
+
import type { AcceptedGiftTypes, BotCommand, BusinessConnection, ChatAdministratorRights, ChatFullInfo, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
|
|
4
5
|
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";
|
|
6
|
+
import type { File, GameHighScore, InputPollOption, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, PreparedInlineMessage, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet, Story } from "./message.js";
|
|
6
7
|
import type { PassportElementError } from "./passport.js";
|
|
7
|
-
import type { Gifts, LabeledPrice, ShippingOption, StarTransactions } from "./payment.js";
|
|
8
|
+
import type { Gifts, LabeledPrice, OwnedGifts, ShippingOption, StarAmount, StarTransactions } from "./payment.js";
|
|
8
9
|
import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
|
|
10
|
+
import { StoryArea } from "./story.js";
|
|
9
11
|
import type { Update } from "./update.js";
|
|
10
12
|
/** Extracts the parameters of a given method name */
|
|
11
13
|
type Params<F, M extends keyof ApiMethods<F>> = Parameters<ApiMethods<F>[M]>;
|
|
@@ -665,7 +667,7 @@ export type ApiMethods<F> = {
|
|
|
665
667
|
question_parse_mode?: ParseMode;
|
|
666
668
|
/** A list of special entities that appear in the poll question. It can be specified instead of question_parse_mode */
|
|
667
669
|
question_entities?: MessageEntity[];
|
|
668
|
-
/** A list of 2-
|
|
670
|
+
/** A list of 2-12 answer options */
|
|
669
671
|
options: InputPollOption[];
|
|
670
672
|
/** True, if the poll needs to be anonymous, defaults to True */
|
|
671
673
|
is_anonymous?: boolean;
|
|
@@ -702,6 +704,38 @@ export type ApiMethods<F> = {
|
|
|
702
704
|
/** @deprecated Use `reply_parameters` instead. */
|
|
703
705
|
reply_to_message_id?: number;
|
|
704
706
|
}): Message.PollMessage;
|
|
707
|
+
/** Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned. */
|
|
708
|
+
sendChecklist(args: {
|
|
709
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
710
|
+
business_connection_id: string;
|
|
711
|
+
/** Unique identifier for the target chat */
|
|
712
|
+
chat_id: number;
|
|
713
|
+
/** An object for the checklist to send */
|
|
714
|
+
checklist: InputChecklist;
|
|
715
|
+
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
716
|
+
disable_notification?: boolean;
|
|
717
|
+
/** Protects the contents of the sent message from forwarding and saving */
|
|
718
|
+
protect_content?: boolean;
|
|
719
|
+
/** Unique identifier of the message effect to be added to the message */
|
|
720
|
+
message_effect_id?: string;
|
|
721
|
+
/** An object for description of the message to reply to */
|
|
722
|
+
reply_parameters?: ReplyParameters;
|
|
723
|
+
/** An object for an inline keyboard */
|
|
724
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
725
|
+
}): Message.ChecklistMessage;
|
|
726
|
+
/** Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned. */
|
|
727
|
+
editMessageChecklist(args: {
|
|
728
|
+
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
729
|
+
business_connection_id: string;
|
|
730
|
+
/** Unique identifier for the target chat */
|
|
731
|
+
chat_id: number;
|
|
732
|
+
/** Unique identifier for the target message */
|
|
733
|
+
message_id: number;
|
|
734
|
+
/** An object for the new checklist */
|
|
735
|
+
checklist: InputChecklist;
|
|
736
|
+
/** An object for the new inline keyboard for the message */
|
|
737
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
738
|
+
}): Message.ChecklistMessage;
|
|
705
739
|
/** Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. */
|
|
706
740
|
sendDice(args: {
|
|
707
741
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
@@ -822,7 +856,7 @@ export type ApiMethods<F> = {
|
|
|
822
856
|
user_id: number;
|
|
823
857
|
/** Pass True if the administrator's presence in the chat is hidden */
|
|
824
858
|
is_anonymous?: boolean;
|
|
825
|
-
/** Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages
|
|
859
|
+
/** Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
|
|
826
860
|
can_manage_chat?: boolean;
|
|
827
861
|
/** Pass True if the administrator can delete messages of other users */
|
|
828
862
|
can_delete_messages?: boolean;
|
|
@@ -842,7 +876,7 @@ export type ApiMethods<F> = {
|
|
|
842
876
|
can_edit_stories?: boolean;
|
|
843
877
|
/** True if the administrator can delete stories posted by other users */
|
|
844
878
|
can_delete_stories?: boolean;
|
|
845
|
-
/** True if the administrator can post messages in the channel, or access channel statistics; for channels only */
|
|
879
|
+
/** Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
|
|
846
880
|
can_post_messages?: boolean;
|
|
847
881
|
/** True if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
848
882
|
can_edit_messages?: boolean;
|
|
@@ -1248,6 +1282,8 @@ export type ApiMethods<F> = {
|
|
|
1248
1282
|
/** Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. */
|
|
1249
1283
|
for_channels?: boolean;
|
|
1250
1284
|
}): ChatAdministratorRights;
|
|
1285
|
+
/** A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object. */
|
|
1286
|
+
getMyStarBalance(): StarAmount;
|
|
1251
1287
|
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent. */
|
|
1252
1288
|
editMessageText(args: {
|
|
1253
1289
|
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
@@ -1352,6 +1388,168 @@ export type ApiMethods<F> = {
|
|
|
1352
1388
|
/** A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted */
|
|
1353
1389
|
message_ids: number[];
|
|
1354
1390
|
}): true;
|
|
1391
|
+
/** 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. */
|
|
1392
|
+
deleteBusinessMessages(args: {
|
|
1393
|
+
/** Unique identifier of the business connection on behalf of which to delete the messages */
|
|
1394
|
+
business_connection_id: string;
|
|
1395
|
+
/** 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 */
|
|
1396
|
+
message_ids: number[];
|
|
1397
|
+
}): true;
|
|
1398
|
+
/** Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success. */
|
|
1399
|
+
setBusinessAccountName(args: {
|
|
1400
|
+
/** Unique identifier of the business connection */
|
|
1401
|
+
business_connection_id: string;
|
|
1402
|
+
/** The new value of the first name for the business account; 1-64 characters */
|
|
1403
|
+
first_name: string;
|
|
1404
|
+
/** The new value of the last name for the business account; 0-64 characters */
|
|
1405
|
+
last_name?: string;
|
|
1406
|
+
}): true;
|
|
1407
|
+
/** Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success. */
|
|
1408
|
+
setBusinessAccountUsername(args: {
|
|
1409
|
+
/** Unique identifier of the business connection */
|
|
1410
|
+
business_connection_id: string;
|
|
1411
|
+
/** The new value of the username for the business account; 0-32 characters */
|
|
1412
|
+
username?: string;
|
|
1413
|
+
}): true;
|
|
1414
|
+
/** Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success. */
|
|
1415
|
+
setBusinessAccountBio(args: {
|
|
1416
|
+
/** Unique identifier of the business connection */
|
|
1417
|
+
business_connection_id: string;
|
|
1418
|
+
/** The new value of the bio for the business account; 0-140 characters */
|
|
1419
|
+
bio?: string;
|
|
1420
|
+
}): true;
|
|
1421
|
+
/** Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. */
|
|
1422
|
+
setBusinessAccountProfilePhoto(args: {
|
|
1423
|
+
/** Unique identifier of the business connection */
|
|
1424
|
+
business_connection_id: string;
|
|
1425
|
+
/** The new profile photo to set */
|
|
1426
|
+
photo: InputProfilePhoto<F>;
|
|
1427
|
+
/** 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. */
|
|
1428
|
+
is_public?: boolean;
|
|
1429
|
+
}): true;
|
|
1430
|
+
/** Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success. */
|
|
1431
|
+
removeBusinessAccountProfilePhoto(args: {
|
|
1432
|
+
/** Unique identifier of the business connection */
|
|
1433
|
+
business_connection_id: string;
|
|
1434
|
+
/** 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. */
|
|
1435
|
+
is_public?: boolean;
|
|
1436
|
+
}): true;
|
|
1437
|
+
/** 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. */
|
|
1438
|
+
setBusinessAccountGiftSettings(args: {
|
|
1439
|
+
/** Unique identifier of the business connection */
|
|
1440
|
+
business_connection_id: string;
|
|
1441
|
+
/** 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 */
|
|
1442
|
+
show_gift_button: boolean;
|
|
1443
|
+
/** Types of gifts accepted by the business account */
|
|
1444
|
+
accepted_gift_types: AcceptedGiftTypes;
|
|
1445
|
+
}): true;
|
|
1446
|
+
/** 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. */
|
|
1447
|
+
getBusinessAccountStarBalance(args: {
|
|
1448
|
+
/** Unique identifier of the business connection */
|
|
1449
|
+
business_connection_id: string;
|
|
1450
|
+
}): StarAmount;
|
|
1451
|
+
/** 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. */
|
|
1452
|
+
transferBusinessAccountStars(args: {
|
|
1453
|
+
/** Unique identifier of the business connection */
|
|
1454
|
+
business_connection_id: string;
|
|
1455
|
+
/** Number of Telegram Stars to transfer; 1-10000 */
|
|
1456
|
+
star_count: number;
|
|
1457
|
+
}): true;
|
|
1458
|
+
/** 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. */
|
|
1459
|
+
getBusinessAccountGifts(args: {
|
|
1460
|
+
/** Unique identifier of the business connection */
|
|
1461
|
+
business_connection_id: string;
|
|
1462
|
+
/** Pass True to exclude gifts that aren't saved to the account's profile page */
|
|
1463
|
+
exclude_unsaved?: boolean;
|
|
1464
|
+
/** Pass True to exclude gifts that are saved to the account's profile page */
|
|
1465
|
+
exclude_saved?: boolean;
|
|
1466
|
+
/** Pass True to exclude gifts that can be purchased an unlimited number of times */
|
|
1467
|
+
exclude_unlimited?: boolean;
|
|
1468
|
+
/** Pass True to exclude gifts that can be purchased a limited number of times */
|
|
1469
|
+
exclude_limited?: boolean;
|
|
1470
|
+
/** Pass True to exclude unique gifts */
|
|
1471
|
+
exclude_unique?: boolean;
|
|
1472
|
+
/** Pass True to sort results by gift price instead of send date. Sorting is applied before pagination. */
|
|
1473
|
+
sort_by_price?: boolean;
|
|
1474
|
+
/** Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results */
|
|
1475
|
+
offset?: string;
|
|
1476
|
+
/** The maximum number of gifts to be returned; 1-100. Defaults to 100 */
|
|
1477
|
+
limit?: number;
|
|
1478
|
+
}): OwnedGifts;
|
|
1479
|
+
/** Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success. */
|
|
1480
|
+
convertGiftToStars(args: {
|
|
1481
|
+
/** Unique identifier of the business connection */
|
|
1482
|
+
business_connection_id: string;
|
|
1483
|
+
/** Unique identifier of the regular gift that should be converted to Telegram Stars */
|
|
1484
|
+
owned_gift_id: string;
|
|
1485
|
+
}): true;
|
|
1486
|
+
/** 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. */
|
|
1487
|
+
upgradeGift(args: {
|
|
1488
|
+
/** Unique identifier of the business connection */
|
|
1489
|
+
business_connection_id: string;
|
|
1490
|
+
/** Unique identifier of the regular gift that should be upgraded to a unique one */
|
|
1491
|
+
owned_gift_id: string;
|
|
1492
|
+
/** Pass True to keep the original gift text, sender and receiver in the upgraded gift */
|
|
1493
|
+
keep_original_details?: boolean;
|
|
1494
|
+
/** 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. */
|
|
1495
|
+
star_count?: number;
|
|
1496
|
+
}): true;
|
|
1497
|
+
/** 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. */
|
|
1498
|
+
transferGift(args: {
|
|
1499
|
+
/** Unique identifier of the business connection */
|
|
1500
|
+
business_connection_id: string;
|
|
1501
|
+
/** Unique identifier of the regular gift that should be transferred */
|
|
1502
|
+
owned_gift_id: string;
|
|
1503
|
+
/** Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours. */
|
|
1504
|
+
new_owner_chat_id: number;
|
|
1505
|
+
/** 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. */
|
|
1506
|
+
star_count: number;
|
|
1507
|
+
}): true;
|
|
1508
|
+
/** Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success. */
|
|
1509
|
+
postStory(args: {
|
|
1510
|
+
/** Unique identifier of the business connection */
|
|
1511
|
+
business_connection_id: string;
|
|
1512
|
+
/** Content of the story */
|
|
1513
|
+
content: InputStoryContent<F>;
|
|
1514
|
+
/** Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 */
|
|
1515
|
+
active_period: number;
|
|
1516
|
+
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1517
|
+
caption?: string;
|
|
1518
|
+
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1519
|
+
parse_mode?: ParseMode;
|
|
1520
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1521
|
+
caption_entities?: MessageEntity[];
|
|
1522
|
+
/** A list of clickable areas to be shown on the story */
|
|
1523
|
+
areas?: StoryArea[];
|
|
1524
|
+
/** Pass True to keep the story accessible after it expires */
|
|
1525
|
+
post_to_chat_page?: boolean;
|
|
1526
|
+
/** Pass True if the content of the story must be protected from forwarding and screenshotting */
|
|
1527
|
+
protect_content?: boolean;
|
|
1528
|
+
}): Story;
|
|
1529
|
+
/** 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. */
|
|
1530
|
+
editStory(args: {
|
|
1531
|
+
/** Unique identifier of the business connection */
|
|
1532
|
+
business_connection_id: string;
|
|
1533
|
+
/** Unique identifier of the story to edit */
|
|
1534
|
+
story_id: number;
|
|
1535
|
+
/** Content of the story */
|
|
1536
|
+
content: InputStoryContent<F>;
|
|
1537
|
+
/** Caption of the story, 0-2048 characters after entities parsing */
|
|
1538
|
+
caption?: string;
|
|
1539
|
+
/** Mode for parsing entities in the story caption. See formatting options for more details. */
|
|
1540
|
+
parse_mode?: ParseMode;
|
|
1541
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
1542
|
+
caption_entities?: MessageEntity[];
|
|
1543
|
+
/** A list of clickable areas to be shown on the story */
|
|
1544
|
+
areas?: StoryArea;
|
|
1545
|
+
}): Story;
|
|
1546
|
+
/** 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. */
|
|
1547
|
+
deleteStory(args: {
|
|
1548
|
+
/** Unique identifier of the business connection */
|
|
1549
|
+
business_connection_id: string;
|
|
1550
|
+
/** Unique identifier of the story to delete */
|
|
1551
|
+
story_id: number;
|
|
1552
|
+
}): true;
|
|
1355
1553
|
/** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
|
|
1356
1554
|
sendSticker(args: {
|
|
1357
1555
|
/** Unique identifier of the business connection on behalf of which the message will be sent */
|
|
@@ -1508,13 +1706,28 @@ export type ApiMethods<F> = {
|
|
|
1508
1706
|
gift_id: string;
|
|
1509
1707
|
/** Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver */
|
|
1510
1708
|
pay_for_upgrade?: boolean;
|
|
1511
|
-
/** Text that will be shown along with the gift; 0-
|
|
1709
|
+
/** Text that will be shown along with the gift; 0-128 characters */
|
|
1512
1710
|
text?: string;
|
|
1513
1711
|
/** 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. */
|
|
1514
1712
|
text_parse_mode?: ParseMode;
|
|
1515
1713
|
/** 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. */
|
|
1516
1714
|
text_entities?: MessageEntity[];
|
|
1517
1715
|
}): Gifts;
|
|
1716
|
+
/** Gifts a Telegram Premium subscription to the given user. Returns True on success. */
|
|
1717
|
+
giftPremiumSubscription(args: {
|
|
1718
|
+
/** Unique identifier of the target user who will receive a Telegram Premium subscription */
|
|
1719
|
+
user_id: number;
|
|
1720
|
+
/** Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12 */
|
|
1721
|
+
month_count: 3 | 6 | 12;
|
|
1722
|
+
/** 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 */
|
|
1723
|
+
star_count: 1000 | 1500 | 2500;
|
|
1724
|
+
/** Text that will be shown along with the service message about the subscription; 0-128 characters */
|
|
1725
|
+
text?: string;
|
|
1726
|
+
/** 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. */
|
|
1727
|
+
text_parse_mode?: ParseMode;
|
|
1728
|
+
/** 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. */
|
|
1729
|
+
text_entities?: MessageEntity[];
|
|
1730
|
+
}): true;
|
|
1518
1731
|
/** Use this method to send answers to an inline query. On success, True is returned.
|
|
1519
1732
|
No more than 50 results per query are allowed.
|
|
1520
1733
|
|
|
@@ -1732,6 +1945,15 @@ export type ApiMethods<F> = {
|
|
|
1732
1945
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
1733
1946
|
chat_id: number | string;
|
|
1734
1947
|
}): true;
|
|
1948
|
+
/** Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success. */
|
|
1949
|
+
readBusinessMessage(args: {
|
|
1950
|
+
/** Unique identifier of the business connection on behalf of which to read the message */
|
|
1951
|
+
business_connection_id: string;
|
|
1952
|
+
/** Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. */
|
|
1953
|
+
chat_id: number;
|
|
1954
|
+
/** Unique identifier of the message to mark as read */
|
|
1955
|
+
message_id: number;
|
|
1956
|
+
}): true;
|
|
1735
1957
|
/** 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.
|
|
1736
1958
|
|
|
1737
1959
|
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. */
|
|
@@ -1961,4 +2183,50 @@ export interface InputPaidMediaVideo<F> {
|
|
|
1961
2183
|
/** Pass True if the uploaded video is suitable for streaming */
|
|
1962
2184
|
supports_streaming?: boolean;
|
|
1963
2185
|
}
|
|
2186
|
+
/** This object describes a profile photo to set. Currently, it can be one of
|
|
2187
|
+
|
|
2188
|
+
- InputProfilePhotoStatic
|
|
2189
|
+
- InputProfilePhotoAnimated */
|
|
2190
|
+
export type InputProfilePhoto<F> = InputProfilePhotoStatic<F> | InputProfilePhotoAnimated<F>;
|
|
2191
|
+
/** A static profile photo in the .JPG format. */
|
|
2192
|
+
export interface InputProfilePhotoStatic<F> {
|
|
2193
|
+
/** Type of the profile photo, must be “static” */
|
|
2194
|
+
type: "static";
|
|
2195
|
+
/** 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 » */
|
|
2196
|
+
photo: F;
|
|
2197
|
+
}
|
|
2198
|
+
/** An animated profile photo in the MPEG4 format. */
|
|
2199
|
+
export interface InputProfilePhotoAnimated<F> {
|
|
2200
|
+
/** Type of the profile photo, must be “animated” */
|
|
2201
|
+
type: "animated";
|
|
2202
|
+
/** 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 » */
|
|
2203
|
+
animation: F;
|
|
2204
|
+
/** Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0. */
|
|
2205
|
+
main_frame_timestamp?: number;
|
|
2206
|
+
}
|
|
2207
|
+
/** This object describes the content of a story to post. Currently, it can be one of
|
|
2208
|
+
|
|
2209
|
+
- InputStoryContentPhoto
|
|
2210
|
+
- InputStoryContentVideo */
|
|
2211
|
+
export type InputStoryContent<F> = InputStoryContentPhoto<F> | InputStoryContentVideo<F>;
|
|
2212
|
+
/** Describes a photo to post as a story. */
|
|
2213
|
+
export interface InputStoryContentPhoto<F> {
|
|
2214
|
+
/** Type of the content, must be “photo” */
|
|
2215
|
+
type: "photo";
|
|
2216
|
+
/** 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 » */
|
|
2217
|
+
photo: F;
|
|
2218
|
+
}
|
|
2219
|
+
/** Describes a video to post as a story. */
|
|
2220
|
+
export interface InputStoryContentVideo<F> {
|
|
2221
|
+
/** Type of the content, must be “video” */
|
|
2222
|
+
type: "video";
|
|
2223
|
+
/** 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 » */
|
|
2224
|
+
video: F;
|
|
2225
|
+
/** Precise duration of the video in seconds; 0-60 */
|
|
2226
|
+
duration?: number;
|
|
2227
|
+
/** Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0. */
|
|
2228
|
+
cover_frame_timestamp?: number;
|
|
2229
|
+
/** Pass True if the video has no sound */
|
|
2230
|
+
is_animation?: boolean;
|
|
2231
|
+
}
|
|
1964
2232
|
export {};
|
package/mod.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./api.js";
|
|
2
|
+
export * from "./checklist.js";
|
|
2
3
|
export * from "./inline.js";
|
|
3
4
|
export * from "./manage.js";
|
|
4
5
|
export * from "./markup.js";
|
|
@@ -7,5 +8,6 @@ export * from "./methods.js";
|
|
|
7
8
|
export * from "./passport.js";
|
|
8
9
|
export * from "./payment.js";
|
|
9
10
|
export * from "./settings.js";
|
|
11
|
+
export * from "./story.js";
|
|
10
12
|
export * from "./update.js";
|
|
11
13
|
export * from "./langs.js";
|
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 */
|
|
@@ -171,20 +171,24 @@ export type TransactionPartner = TransactionPartnerUser | TransactionPartnerChat
|
|
|
171
171
|
export interface TransactionPartnerUser {
|
|
172
172
|
/** Type of the transaction partner, always “user” */
|
|
173
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";
|
|
174
176
|
/** Information about the user */
|
|
175
177
|
user: User;
|
|
176
|
-
/** 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. */
|
|
177
179
|
affiliate?: AffiliateInfo;
|
|
178
|
-
/** Bot-specified invoice payload */
|
|
180
|
+
/** Bot-specified invoice payload. Can be available only for “invoice_payment” transactions. */
|
|
179
181
|
invoice_payload?: string;
|
|
180
|
-
/** The duration of the paid subscription */
|
|
182
|
+
/** The duration of the paid subscription. Can be available only for “invoice_payment” transactions. */
|
|
181
183
|
subscription_period?: number;
|
|
182
|
-
/** 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 */
|
|
183
185
|
paid_media?: PaidMedia[];
|
|
184
|
-
/** Bot-specified paid media payload */
|
|
186
|
+
/** Bot-specified paid media payload. Can be available only for “paid_media_payment” transactions. */
|
|
185
187
|
paid_media_payload?: string;
|
|
186
|
-
/** The gift sent to the user by the bot */
|
|
188
|
+
/** The gift sent to the user by the bot; for “gift_purchase” transactions only */
|
|
187
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;
|
|
188
192
|
}
|
|
189
193
|
/** Describes a transaction with a chat. */
|
|
190
194
|
export interface TransactionPartnerChat {
|
|
@@ -275,3 +279,166 @@ export interface Gifts {
|
|
|
275
279
|
/** The list of gifts */
|
|
276
280
|
gifts: Gift[];
|
|
277
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” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, or “resale” for gifts bought from other users */
|
|
359
|
+
origin: "upgrade" | "transfer" | "resale";
|
|
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
|
+
/** For gifts bought from other users, the price paid for the gift */
|
|
365
|
+
last_resale_star_count?: number;
|
|
366
|
+
/** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
|
|
367
|
+
next_transfer_date?: string;
|
|
368
|
+
}
|
|
369
|
+
/** Describes a service message about a change in the price of paid messages within a chat. */
|
|
370
|
+
export interface PaidMessagePriceChanged {
|
|
371
|
+
/** The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message */
|
|
372
|
+
paid_message_star_count: number;
|
|
373
|
+
}
|
|
374
|
+
/** Describes an amount of Telegram Stars. */
|
|
375
|
+
export interface StarAmount {
|
|
376
|
+
/** Integer amount of Telegram Stars, rounded to 0; can be negative */
|
|
377
|
+
amount: number;
|
|
378
|
+
/** The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive */
|
|
379
|
+
nanostar_amount?: number;
|
|
380
|
+
}
|
|
381
|
+
/** This object describes a gift received and owned by a user or a chat. Currently, it can be one of
|
|
382
|
+
|
|
383
|
+
- OwnedGiftRegular
|
|
384
|
+
- OwnedGiftUnique */
|
|
385
|
+
export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique;
|
|
386
|
+
/** Describes a regular gift owned by a user or a chat. */
|
|
387
|
+
export interface OwnedGiftRegular {
|
|
388
|
+
/** Type of the gift, always “regular” */
|
|
389
|
+
type: "regular";
|
|
390
|
+
/** Information about the regular gift */
|
|
391
|
+
gift: Gift;
|
|
392
|
+
/** Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only */
|
|
393
|
+
owned_gift_id?: string;
|
|
394
|
+
/** Sender of the gift if it is a known user */
|
|
395
|
+
sender_user?: User;
|
|
396
|
+
/** Date the gift was sent in Unix time */
|
|
397
|
+
send_date: number;
|
|
398
|
+
/** Text of the message that was added to the gift */
|
|
399
|
+
text?: string;
|
|
400
|
+
/** Special entities that appear in the text */
|
|
401
|
+
entities?: MessageEntity[];
|
|
402
|
+
/** True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
|
|
403
|
+
is_private?: true;
|
|
404
|
+
/** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
|
|
405
|
+
is_saved?: true;
|
|
406
|
+
/** True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only */
|
|
407
|
+
can_be_upgraded?: true;
|
|
408
|
+
/** True, if the gift was refunded and isn't available anymore */
|
|
409
|
+
was_refunded?: true;
|
|
410
|
+
/** 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 */
|
|
411
|
+
convert_star_count?: number;
|
|
412
|
+
/** Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift */
|
|
413
|
+
prepaid_upgrade_star_count?: number;
|
|
414
|
+
}
|
|
415
|
+
/** Describes a unique gift received and owned by a user or a chat. */
|
|
416
|
+
export interface OwnedGiftUnique {
|
|
417
|
+
/** Type of the gift, always “unique” */
|
|
418
|
+
type: "unique";
|
|
419
|
+
/** Information about the unique gift */
|
|
420
|
+
gift: UniqueGift;
|
|
421
|
+
/** Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only */
|
|
422
|
+
owned_gift_id?: string;
|
|
423
|
+
/** Sender of the gift if it is a known user */
|
|
424
|
+
sender_user?: User;
|
|
425
|
+
/** Date the gift was sent in Unix time */
|
|
426
|
+
send_date: number;
|
|
427
|
+
/** True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
|
|
428
|
+
is_saved?: true;
|
|
429
|
+
/** True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only */
|
|
430
|
+
can_be_transferred?: true;
|
|
431
|
+
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
|
|
432
|
+
transfer_star_count?: number;
|
|
433
|
+
/** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
|
|
434
|
+
next_transfer_date?: string;
|
|
435
|
+
}
|
|
436
|
+
/** Contains the list of gifts received and owned by a user or a chat. */
|
|
437
|
+
export interface OwnedGifts {
|
|
438
|
+
/** The total number of gifts owned by the user or the chat */
|
|
439
|
+
total_count: number;
|
|
440
|
+
/** The list of gifts */
|
|
441
|
+
gifts: OwnedGift[];
|
|
442
|
+
/** Offset for the next request. If empty, then there are no more results */
|
|
443
|
+
next_offset?: string;
|
|
444
|
+
}
|
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
|
+
}
|