tgplus 1.0.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/LICENSE +52 -0
- package/README.md +1512 -0
- package/dist/adapters.d.ts +46 -0
- package/dist/adapters.js +83 -0
- package/dist/adapters.js.map +1 -0
- package/dist/bot.d.ts +50 -0
- package/dist/bot.js +180 -0
- package/dist/bot.js.map +1 -0
- package/dist/client.d.ts +1139 -0
- package/dist/client.js +529 -0
- package/dist/client.js.map +1 -0
- package/dist/composer.d.ts +88 -0
- package/dist/composer.js +233 -0
- package/dist/composer.js.map +1 -0
- package/dist/context.d.ts +72 -0
- package/dist/context.js +149 -0
- package/dist/context.js.map +1 -0
- package/dist/decorators.d.ts +33 -0
- package/dist/decorators.js +39 -0
- package/dist/decorators.js.map +1 -0
- package/dist/filters.d.ts +19 -0
- package/dist/filters.js +81 -0
- package/dist/filters.js.map +1 -0
- package/dist/i18n.d.ts +30 -0
- package/dist/i18n.js +41 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/keyboard.d.ts +62 -0
- package/dist/keyboard.js +96 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/rateLimit.d.ts +19 -0
- package/dist/rateLimit.js +32 -0
- package/dist/rateLimit.js.map +1 -0
- package/dist/richMessage.d.ts +111 -0
- package/dist/richMessage.js +221 -0
- package/dist/richMessage.js.map +1 -0
- package/dist/scenes.d.ts +57 -0
- package/dist/scenes.js +105 -0
- package/dist/scenes.js.map +1 -0
- package/dist/session-redis.d.ts +27 -0
- package/dist/session-redis.js +36 -0
- package/dist/session-redis.js.map +1 -0
- package/dist/session-sqlite.d.ts +29 -0
- package/dist/session-sqlite.js +34 -0
- package/dist/session-sqlite.js.map +1 -0
- package/dist/session.d.ts +30 -0
- package/dist/session.js +35 -0
- package/dist/session.js.map +1 -0
- package/dist/types.d.ts +2485 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/package.json +42 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,2485 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tgplus — Telegram Bot API type definitions
|
|
3
|
+
* Tracks Bot API 10.3 (2026-08-24), including Rich Messages, Ephemeral Messages, and Managed Bots.
|
|
4
|
+
* Not every field of every object is written by hand: `[key: string]: any`
|
|
5
|
+
* escape hatches are intentionally avoided here so you get real autocomplete,
|
|
6
|
+
* but `RawApiMethods` in client.ts covers any method not yet given a typed
|
|
7
|
+
* wrapper, so a new Bot API release never blocks you.
|
|
8
|
+
*/
|
|
9
|
+
export type Integer = number;
|
|
10
|
+
export type FileId = string;
|
|
11
|
+
export type ChatId = number | string;
|
|
12
|
+
export interface User {
|
|
13
|
+
id: Integer;
|
|
14
|
+
is_bot: boolean;
|
|
15
|
+
first_name: string;
|
|
16
|
+
last_name?: string;
|
|
17
|
+
username?: string;
|
|
18
|
+
language_code?: string;
|
|
19
|
+
is_premium?: boolean;
|
|
20
|
+
added_to_attachment_menu?: boolean;
|
|
21
|
+
can_join_groups?: boolean;
|
|
22
|
+
can_read_all_group_messages?: boolean;
|
|
23
|
+
supports_inline_queries?: boolean;
|
|
24
|
+
can_connect_to_business?: boolean;
|
|
25
|
+
has_main_web_app?: boolean;
|
|
26
|
+
/** Bot API 9.6+: this bot can create and manage other bots (Managed Bots). */
|
|
27
|
+
can_manage_bots?: boolean;
|
|
28
|
+
/** Bot API 10.1+ */
|
|
29
|
+
supports_join_request_queries?: boolean;
|
|
30
|
+
/** Bot API 10.0+ (Guest mode) */
|
|
31
|
+
supports_guest_queries?: boolean;
|
|
32
|
+
/** Bot API 9.6+: whether forum topic mode is enabled for the bot in private chats. */
|
|
33
|
+
has_topics_enabled?: boolean;
|
|
34
|
+
/** Discovered via live getMe() response — whether users can create forum topics with this bot in private chats. */
|
|
35
|
+
allows_users_to_create_topics?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export type ChatType = "private" | "group" | "supergroup" | "channel";
|
|
38
|
+
export interface Chat {
|
|
39
|
+
id: Integer;
|
|
40
|
+
type: ChatType;
|
|
41
|
+
title?: string;
|
|
42
|
+
username?: string;
|
|
43
|
+
first_name?: string;
|
|
44
|
+
last_name?: string;
|
|
45
|
+
is_forum?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface ChatFullInfo extends Chat {
|
|
48
|
+
photo?: ChatPhoto;
|
|
49
|
+
active_usernames?: string[];
|
|
50
|
+
bio?: string;
|
|
51
|
+
has_private_forwards?: boolean;
|
|
52
|
+
join_to_send_messages?: boolean;
|
|
53
|
+
join_by_request?: boolean;
|
|
54
|
+
description?: string;
|
|
55
|
+
invite_link?: string;
|
|
56
|
+
pinned_message?: Message;
|
|
57
|
+
permissions?: ChatPermissions;
|
|
58
|
+
slow_mode_delay?: Integer;
|
|
59
|
+
message_auto_delete_time?: Integer;
|
|
60
|
+
has_aggressive_anti_spam_enabled?: boolean;
|
|
61
|
+
has_hidden_members?: boolean;
|
|
62
|
+
has_protected_content?: boolean;
|
|
63
|
+
guard_bot?: User;
|
|
64
|
+
/** @deprecated replaced by accepted_gift_types (AcceptedGiftTypes) — kept only for reading old cached data. */
|
|
65
|
+
can_send_gift?: boolean;
|
|
66
|
+
accepted_gift_types?: AcceptedGiftTypes;
|
|
67
|
+
/** Bot API 9.2+: true for a supergroup used as a channel's Direct Messages chat. */
|
|
68
|
+
is_direct_messages?: boolean;
|
|
69
|
+
/** Bot API 9.2+: the parent channel chat, when is_direct_messages is true. */
|
|
70
|
+
parent_chat?: Chat;
|
|
71
|
+
sticker_set_name?: string;
|
|
72
|
+
can_set_sticker_set?: boolean;
|
|
73
|
+
linked_chat_id?: Integer;
|
|
74
|
+
location?: ChatLocation;
|
|
75
|
+
/** Bot API 10.2+: present if this chat belongs to a Community (several linked supergroups/channels/bots around a shared topic). */
|
|
76
|
+
community?: Community;
|
|
77
|
+
birthdate?: {
|
|
78
|
+
day: Integer;
|
|
79
|
+
month: Integer;
|
|
80
|
+
year?: Integer;
|
|
81
|
+
};
|
|
82
|
+
business_intro?: BusinessIntro;
|
|
83
|
+
business_location?: BusinessLocation;
|
|
84
|
+
business_opening_hours?: BusinessOpeningHours;
|
|
85
|
+
personal_chat?: Chat;
|
|
86
|
+
available_reactions?: ReactionType[];
|
|
87
|
+
accent_color_id?: Integer;
|
|
88
|
+
profile_accent_color_id?: Integer;
|
|
89
|
+
has_visible_history?: boolean;
|
|
90
|
+
emoji_status_custom_emoji_id?: string;
|
|
91
|
+
emoji_status_expiration_date?: Integer;
|
|
92
|
+
background_custom_emoji_id?: string;
|
|
93
|
+
profile_background_custom_emoji_id?: string;
|
|
94
|
+
custom_emoji_sticker_set_name?: string;
|
|
95
|
+
unrestrict_boost_count?: Integer;
|
|
96
|
+
can_send_paid_media?: boolean;
|
|
97
|
+
background?: ChatBackground;
|
|
98
|
+
/** Bot API 9.3+ */
|
|
99
|
+
rating?: UserRating;
|
|
100
|
+
paid_message_star_count?: Integer;
|
|
101
|
+
unique_gift_colors?: UniqueGiftColors;
|
|
102
|
+
/** Bot API 9.4+ */
|
|
103
|
+
first_profile_audio?: Audio;
|
|
104
|
+
}
|
|
105
|
+
/** Several supergroups, channels, and bots linked together around a shared topic or audience. */
|
|
106
|
+
export interface Community {
|
|
107
|
+
id: Integer;
|
|
108
|
+
title: string;
|
|
109
|
+
photo?: ChatPhoto;
|
|
110
|
+
}
|
|
111
|
+
export interface CommunityChatAdded {
|
|
112
|
+
community: Community;
|
|
113
|
+
}
|
|
114
|
+
export interface CommunityChatRemoved {
|
|
115
|
+
community: Community;
|
|
116
|
+
}
|
|
117
|
+
/** Bot API 10.3+: service message about a chat joining a community. */
|
|
118
|
+
export interface CommunityChatJoined {
|
|
119
|
+
community: Community;
|
|
120
|
+
}
|
|
121
|
+
export interface ChatPhoto {
|
|
122
|
+
small_file_id: FileId;
|
|
123
|
+
small_file_unique_id: string;
|
|
124
|
+
big_file_id: FileId;
|
|
125
|
+
big_file_unique_id: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ChatPermissions {
|
|
128
|
+
can_send_messages?: boolean;
|
|
129
|
+
can_send_audios?: boolean;
|
|
130
|
+
can_send_documents?: boolean;
|
|
131
|
+
can_send_photos?: boolean;
|
|
132
|
+
can_send_videos?: boolean;
|
|
133
|
+
can_send_video_notes?: boolean;
|
|
134
|
+
can_send_voice_notes?: boolean;
|
|
135
|
+
can_send_polls?: boolean;
|
|
136
|
+
can_send_other_messages?: boolean;
|
|
137
|
+
can_add_web_page_previews?: boolean;
|
|
138
|
+
can_change_info?: boolean;
|
|
139
|
+
can_invite_users?: boolean;
|
|
140
|
+
can_pin_messages?: boolean;
|
|
141
|
+
can_manage_topics?: boolean;
|
|
142
|
+
/** Bot API 10.0+ */
|
|
143
|
+
can_react_to_messages?: boolean;
|
|
144
|
+
/** Bot API 9.5+ */
|
|
145
|
+
can_edit_tag?: boolean;
|
|
146
|
+
}
|
|
147
|
+
export interface ChatLocation {
|
|
148
|
+
location: Location;
|
|
149
|
+
address: string;
|
|
150
|
+
}
|
|
151
|
+
export interface Location {
|
|
152
|
+
longitude: number;
|
|
153
|
+
latitude: number;
|
|
154
|
+
horizontal_accuracy?: number;
|
|
155
|
+
live_period?: Integer;
|
|
156
|
+
heading?: Integer;
|
|
157
|
+
proximity_alert_radius?: Integer;
|
|
158
|
+
}
|
|
159
|
+
export interface MessageEntity {
|
|
160
|
+
type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "expandable_blockquote" | "code" | "pre" | "text_link" | "text_mention" | "custom_emoji" | "date_time";
|
|
161
|
+
offset: Integer;
|
|
162
|
+
length: Integer;
|
|
163
|
+
url?: string;
|
|
164
|
+
user?: User;
|
|
165
|
+
language?: string;
|
|
166
|
+
custom_emoji_id?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The structured reply mechanism introduced in Bot API 7.0, replacing the old
|
|
170
|
+
* flat reply_to_message_id / allow_sending_without_reply parameters. Pass this
|
|
171
|
+
* as `reply_parameters` on any send* method instead of the old flat fields.
|
|
172
|
+
*/
|
|
173
|
+
export interface ReplyParameters {
|
|
174
|
+
message_id?: Integer;
|
|
175
|
+
chat_id?: ChatId;
|
|
176
|
+
allow_sending_without_reply?: boolean;
|
|
177
|
+
quote?: string;
|
|
178
|
+
quote_parse_mode?: ParseMode;
|
|
179
|
+
quote_entities?: MessageEntity[];
|
|
180
|
+
quote_position?: Integer;
|
|
181
|
+
/** Bot API 9.1+: reply to a specific task within a checklist message. */
|
|
182
|
+
checklist_task_id?: Integer;
|
|
183
|
+
/** Bot API 9.6+: reply to a specific option within a poll message. */
|
|
184
|
+
poll_option_id?: Integer;
|
|
185
|
+
/** Bot API 10.2+: reply to an ephemeral message (message_id becomes optional when this is set). */
|
|
186
|
+
ephemeral_message_id?: Integer;
|
|
187
|
+
}
|
|
188
|
+
/** The quoted portion of a replied-to message, when the reply only quotes part of it. */
|
|
189
|
+
export interface TextQuote {
|
|
190
|
+
text: string;
|
|
191
|
+
entities?: MessageEntity[];
|
|
192
|
+
position: Integer;
|
|
193
|
+
is_manual?: boolean;
|
|
194
|
+
}
|
|
195
|
+
/** Info about a message that is replied to, possibly from another chat/forum topic — doesn't carry the full Message. */
|
|
196
|
+
export interface ExternalReplyInfo {
|
|
197
|
+
origin: MessageOrigin;
|
|
198
|
+
chat?: Chat;
|
|
199
|
+
message_id?: Integer;
|
|
200
|
+
link_preview_options?: LinkPreviewOptions;
|
|
201
|
+
animation?: Animation;
|
|
202
|
+
audio?: Audio;
|
|
203
|
+
document?: Document;
|
|
204
|
+
photo?: PhotoSize[];
|
|
205
|
+
live_photo?: LivePhoto;
|
|
206
|
+
sticker?: Sticker;
|
|
207
|
+
story?: Story;
|
|
208
|
+
video?: Video;
|
|
209
|
+
video_note?: VideoNote;
|
|
210
|
+
voice?: Voice;
|
|
211
|
+
has_media_spoiler?: boolean;
|
|
212
|
+
contact?: Contact;
|
|
213
|
+
dice?: Dice;
|
|
214
|
+
giveaway?: Giveaway;
|
|
215
|
+
giveaway_winners?: GiveawayWinners;
|
|
216
|
+
invoice?: Record<string, unknown>;
|
|
217
|
+
location?: Location;
|
|
218
|
+
poll?: Poll;
|
|
219
|
+
venue?: Venue;
|
|
220
|
+
checklist?: Checklist;
|
|
221
|
+
}
|
|
222
|
+
/** Bot API 7.0+: replaced the old forward_from/forward_from_chat/forward_date flat fields on Message. */
|
|
223
|
+
export type MessageOrigin = MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel;
|
|
224
|
+
export interface MessageOriginUser {
|
|
225
|
+
type: "user";
|
|
226
|
+
date: Integer;
|
|
227
|
+
sender_user: User;
|
|
228
|
+
}
|
|
229
|
+
export interface MessageOriginHiddenUser {
|
|
230
|
+
type: "hidden_user";
|
|
231
|
+
date: Integer;
|
|
232
|
+
sender_user_name: string;
|
|
233
|
+
}
|
|
234
|
+
export interface MessageOriginChat {
|
|
235
|
+
type: "chat";
|
|
236
|
+
date: Integer;
|
|
237
|
+
sender_chat: Chat;
|
|
238
|
+
author_signature?: string;
|
|
239
|
+
}
|
|
240
|
+
export interface MessageOriginChannel {
|
|
241
|
+
type: "channel";
|
|
242
|
+
date: Integer;
|
|
243
|
+
chat: Chat;
|
|
244
|
+
message_id: Integer;
|
|
245
|
+
author_signature?: string;
|
|
246
|
+
}
|
|
247
|
+
export interface LinkPreviewOptions {
|
|
248
|
+
is_disabled?: boolean;
|
|
249
|
+
url?: string;
|
|
250
|
+
prefer_small_media?: boolean;
|
|
251
|
+
prefer_large_media?: boolean;
|
|
252
|
+
show_above_text?: boolean;
|
|
253
|
+
}
|
|
254
|
+
/** Bot API 7.0+: getChat's pinned_message and callback_query's message can be this instead of a full Message. */
|
|
255
|
+
export interface InaccessibleMessage {
|
|
256
|
+
chat: Chat;
|
|
257
|
+
message_id: Integer;
|
|
258
|
+
date: 0;
|
|
259
|
+
}
|
|
260
|
+
export type MaybeInaccessibleMessage = Message | InaccessibleMessage;
|
|
261
|
+
export interface Message {
|
|
262
|
+
message_id: Integer;
|
|
263
|
+
message_thread_id?: Integer;
|
|
264
|
+
from?: User;
|
|
265
|
+
sender_chat?: Chat;
|
|
266
|
+
date: Integer;
|
|
267
|
+
/** Present on business messages — identifies which business connection this message came through, required for calling business account methods in response. */
|
|
268
|
+
business_connection_id?: string;
|
|
269
|
+
chat: Chat;
|
|
270
|
+
reply_to_message?: Message;
|
|
271
|
+
external_reply?: ExternalReplyInfo;
|
|
272
|
+
quote?: TextQuote;
|
|
273
|
+
reply_to_story?: Story;
|
|
274
|
+
forward_origin?: MessageOrigin;
|
|
275
|
+
is_automatic_forward?: boolean;
|
|
276
|
+
link_preview_options?: LinkPreviewOptions;
|
|
277
|
+
edit_date?: Integer;
|
|
278
|
+
text?: string;
|
|
279
|
+
entities?: MessageEntity[];
|
|
280
|
+
caption?: string;
|
|
281
|
+
caption_entities?: MessageEntity[];
|
|
282
|
+
show_caption_above_media?: boolean;
|
|
283
|
+
photo?: PhotoSize[];
|
|
284
|
+
video?: Video;
|
|
285
|
+
animation?: Animation;
|
|
286
|
+
audio?: Audio;
|
|
287
|
+
document?: Document;
|
|
288
|
+
sticker?: Sticker;
|
|
289
|
+
voice?: Voice;
|
|
290
|
+
video_note?: VideoNote;
|
|
291
|
+
contact?: Contact;
|
|
292
|
+
location?: Location;
|
|
293
|
+
venue?: Venue;
|
|
294
|
+
poll?: Poll;
|
|
295
|
+
dice?: Dice;
|
|
296
|
+
new_chat_members?: User[];
|
|
297
|
+
left_chat_member?: User;
|
|
298
|
+
new_chat_title?: string;
|
|
299
|
+
new_chat_photo?: PhotoSize[];
|
|
300
|
+
pinned_message?: Message;
|
|
301
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
302
|
+
is_topic_message?: boolean;
|
|
303
|
+
rich_message?: RichMessage;
|
|
304
|
+
giveaway?: Giveaway;
|
|
305
|
+
giveaway_created?: GiveawayCreated;
|
|
306
|
+
giveaway_winners?: GiveawayWinners;
|
|
307
|
+
giveaway_completed?: GiveawayCompleted;
|
|
308
|
+
story?: Story;
|
|
309
|
+
users_shared?: UsersShared;
|
|
310
|
+
/** @deprecated replaced by users_shared — kept for reading old cached data. */
|
|
311
|
+
user_shared?: UsersShared;
|
|
312
|
+
chat_shared?: ChatShared;
|
|
313
|
+
write_access_allowed?: WriteAccessAllowed;
|
|
314
|
+
video_chat_started?: VideoChatStarted;
|
|
315
|
+
video_chat_ended?: VideoChatEnded;
|
|
316
|
+
video_chat_scheduled?: VideoChatScheduled;
|
|
317
|
+
video_chat_participants_invited?: VideoChatParticipantsInvited;
|
|
318
|
+
forum_topic_created?: ForumTopicCreated;
|
|
319
|
+
forum_topic_edited?: ForumTopicEdited;
|
|
320
|
+
forum_topic_closed?: ForumTopicClosed;
|
|
321
|
+
forum_topic_reopened?: ForumTopicReopened;
|
|
322
|
+
general_forum_topic_hidden?: GeneralForumTopicHidden;
|
|
323
|
+
general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
|
|
324
|
+
/** Bot API 9.2+: true if this message is a suggested post that was posted after payment. */
|
|
325
|
+
is_paid_post?: boolean;
|
|
326
|
+
/** Bot API 9.5+: the tag of the sender, if the chat has tags enabled. */
|
|
327
|
+
sender_tag?: string;
|
|
328
|
+
/** Bot API 10.2+: for ephemeral messages, the one user who can see this message besides the bot. */
|
|
329
|
+
receiver_user?: User;
|
|
330
|
+
/** Bot API 10.2+: present on ephemeral messages. */
|
|
331
|
+
ephemeral_message_id?: Integer;
|
|
332
|
+
/** Bot API 10.2+ service messages for Communities. */
|
|
333
|
+
community_chat_added?: CommunityChatAdded;
|
|
334
|
+
community_chat_removed?: CommunityChatRemoved;
|
|
335
|
+
/** Bot API 10.3+: service message about a chat joining a community. */
|
|
336
|
+
community_chat_joined?: CommunityChatJoined;
|
|
337
|
+
checklist?: Checklist;
|
|
338
|
+
checklist_tasks_done?: ChecklistTasksDone;
|
|
339
|
+
checklist_tasks_added?: ChecklistTasksAdded;
|
|
340
|
+
/** Bot API 9.1+: this message is a reply to a specific checklist task. */
|
|
341
|
+
reply_to_checklist_task_id?: Integer;
|
|
342
|
+
/** Bot API 9.6+: this message is a reply to a specific poll option. */
|
|
343
|
+
reply_to_poll_option_id?: Integer;
|
|
344
|
+
/** Bot API 9.3+: service message about a gift upgrade being sent. */
|
|
345
|
+
gift_upgrade_sent?: Record<string, unknown>;
|
|
346
|
+
poll_option_added?: PollOptionAdded;
|
|
347
|
+
poll_option_deleted?: PollOptionDeleted;
|
|
348
|
+
/** Bot API 8.0+: service message for a regular gift sent/received. */
|
|
349
|
+
gift?: GiftInfo;
|
|
350
|
+
/** Bot API 9.0+: service message for a unique (upgraded) gift sent/received. */
|
|
351
|
+
unique_gift?: UniqueGiftInfo;
|
|
352
|
+
suggested_post_approved?: SuggestedPostApproved;
|
|
353
|
+
suggested_post_approval_failed?: SuggestedPostApprovalFailed;
|
|
354
|
+
suggested_post_declined?: SuggestedPostDeclined;
|
|
355
|
+
suggested_post_paid?: SuggestedPostPaid;
|
|
356
|
+
suggested_post_refunded?: SuggestedPostRefunded;
|
|
357
|
+
/** Bot API 9.2+: present when this message is itself a suggested post awaiting approval. */
|
|
358
|
+
suggested_post_info?: SuggestedPostInfo;
|
|
359
|
+
direct_messages_topic?: DirectMessagesTopic;
|
|
360
|
+
/** Bot API 10.0+ (Guest mode): set when a non-member bot was @mentioned in a chat. */
|
|
361
|
+
guest_bot_caller_user?: User;
|
|
362
|
+
guest_bot_caller_chat?: Chat;
|
|
363
|
+
paid_media?: PaidMediaInfo;
|
|
364
|
+
/** Bot API 9.0+: number of Telegram Stars paid to send this message (paid messages / paid broadcast). */
|
|
365
|
+
paid_star_count?: Integer;
|
|
366
|
+
message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged;
|
|
367
|
+
/** Surfaced on a bot's own channel post when someone purchases its paid media. */
|
|
368
|
+
purchased_paid_media?: PaidMediaPurchased;
|
|
369
|
+
chat_owner_left?: ChatOwnerLeft;
|
|
370
|
+
chat_owner_changed?: ChatOwnerChanged;
|
|
371
|
+
paid_message_price_changed?: PaidMessagePriceChanged;
|
|
372
|
+
direct_message_price_changed?: DirectMessagePriceChanged;
|
|
373
|
+
successful_payment?: SuccessfulPayment;
|
|
374
|
+
refunded_payment?: RefundedPayment;
|
|
375
|
+
invoice?: Invoice;
|
|
376
|
+
passport_data?: PassportData;
|
|
377
|
+
[extra: string]: unknown;
|
|
378
|
+
}
|
|
379
|
+
export interface PhotoSize {
|
|
380
|
+
file_id: FileId;
|
|
381
|
+
file_unique_id: string;
|
|
382
|
+
width: Integer;
|
|
383
|
+
height: Integer;
|
|
384
|
+
file_size?: Integer;
|
|
385
|
+
}
|
|
386
|
+
export interface VideoQuality {
|
|
387
|
+
width: Integer;
|
|
388
|
+
height: Integer;
|
|
389
|
+
codec: string;
|
|
390
|
+
file_id: FileId;
|
|
391
|
+
file_unique_id: string;
|
|
392
|
+
file_size?: Integer;
|
|
393
|
+
bitrate?: Integer;
|
|
394
|
+
}
|
|
395
|
+
export interface Video {
|
|
396
|
+
file_id: FileId;
|
|
397
|
+
file_unique_id: string;
|
|
398
|
+
width: Integer;
|
|
399
|
+
height: Integer;
|
|
400
|
+
duration: Integer;
|
|
401
|
+
thumbnail?: PhotoSize;
|
|
402
|
+
cover?: PhotoSize[];
|
|
403
|
+
start_timestamp?: Integer;
|
|
404
|
+
file_name?: string;
|
|
405
|
+
mime_type?: string;
|
|
406
|
+
file_size?: Integer;
|
|
407
|
+
/** Bot API 9.6+: other available qualities of this video. */
|
|
408
|
+
qualities?: VideoQuality[];
|
|
409
|
+
}
|
|
410
|
+
export interface Animation extends Video {
|
|
411
|
+
}
|
|
412
|
+
export interface Audio {
|
|
413
|
+
file_id: FileId;
|
|
414
|
+
file_unique_id: string;
|
|
415
|
+
duration: Integer;
|
|
416
|
+
performer?: string;
|
|
417
|
+
title?: string;
|
|
418
|
+
file_name?: string;
|
|
419
|
+
mime_type?: string;
|
|
420
|
+
file_size?: Integer;
|
|
421
|
+
thumbnail?: PhotoSize;
|
|
422
|
+
}
|
|
423
|
+
export interface Document {
|
|
424
|
+
file_id: FileId;
|
|
425
|
+
file_unique_id: string;
|
|
426
|
+
thumbnail?: PhotoSize;
|
|
427
|
+
file_name?: string;
|
|
428
|
+
mime_type?: string;
|
|
429
|
+
file_size?: Integer;
|
|
430
|
+
}
|
|
431
|
+
export interface Voice {
|
|
432
|
+
file_id: FileId;
|
|
433
|
+
file_unique_id: string;
|
|
434
|
+
duration: Integer;
|
|
435
|
+
mime_type?: string;
|
|
436
|
+
file_size?: Integer;
|
|
437
|
+
}
|
|
438
|
+
export interface VideoNote {
|
|
439
|
+
file_id: FileId;
|
|
440
|
+
file_unique_id: string;
|
|
441
|
+
length: Integer;
|
|
442
|
+
duration: Integer;
|
|
443
|
+
thumbnail?: PhotoSize;
|
|
444
|
+
file_size?: Integer;
|
|
445
|
+
}
|
|
446
|
+
export interface Sticker {
|
|
447
|
+
file_id: FileId;
|
|
448
|
+
file_unique_id: string;
|
|
449
|
+
type: "regular" | "mask" | "custom_emoji";
|
|
450
|
+
width: Integer;
|
|
451
|
+
height: Integer;
|
|
452
|
+
is_animated: boolean;
|
|
453
|
+
is_video: boolean;
|
|
454
|
+
thumbnail?: PhotoSize;
|
|
455
|
+
emoji?: string;
|
|
456
|
+
set_name?: string;
|
|
457
|
+
premium_animation?: File;
|
|
458
|
+
mask_position?: MaskPosition;
|
|
459
|
+
custom_emoji_id?: string;
|
|
460
|
+
needs_repainting?: boolean;
|
|
461
|
+
file_size?: Integer;
|
|
462
|
+
}
|
|
463
|
+
export interface Contact {
|
|
464
|
+
phone_number: string;
|
|
465
|
+
first_name: string;
|
|
466
|
+
last_name?: string;
|
|
467
|
+
user_id?: Integer;
|
|
468
|
+
vcard?: string;
|
|
469
|
+
}
|
|
470
|
+
export interface Venue {
|
|
471
|
+
location: Location;
|
|
472
|
+
title: string;
|
|
473
|
+
address: string;
|
|
474
|
+
foursquare_id?: string;
|
|
475
|
+
}
|
|
476
|
+
export interface Poll {
|
|
477
|
+
id: string;
|
|
478
|
+
question: string;
|
|
479
|
+
question_entities?: MessageEntity[];
|
|
480
|
+
options: PollOption[];
|
|
481
|
+
total_voter_count: Integer;
|
|
482
|
+
is_closed: boolean;
|
|
483
|
+
is_anonymous: boolean;
|
|
484
|
+
type: "regular" | "quiz";
|
|
485
|
+
allows_multiple_answers: boolean;
|
|
486
|
+
/** @deprecated replaced by correct_option_ids (plural) in Bot API 9.6, which added multi-answer quiz support. Kept for reading old cached data only. */
|
|
487
|
+
correct_option_id?: Integer;
|
|
488
|
+
/** Bot API 9.6+: 0-based identifiers of correct answer options for a quiz. Plural because quizzes can now have multiple correct answers. */
|
|
489
|
+
correct_option_ids?: Integer[];
|
|
490
|
+
explanation?: string;
|
|
491
|
+
explanation_entities?: MessageEntity[];
|
|
492
|
+
explanation_media?: PollMedia;
|
|
493
|
+
open_period?: Integer;
|
|
494
|
+
close_date?: Integer;
|
|
495
|
+
media?: PollMedia;
|
|
496
|
+
allows_revoting?: boolean;
|
|
497
|
+
description?: string;
|
|
498
|
+
description_entities?: MessageEntity[];
|
|
499
|
+
country_codes?: string[];
|
|
500
|
+
members_only?: boolean;
|
|
501
|
+
}
|
|
502
|
+
export interface PollOption {
|
|
503
|
+
text: string;
|
|
504
|
+
text_entities?: MessageEntity[];
|
|
505
|
+
voter_count: Integer;
|
|
506
|
+
media?: PollMedia;
|
|
507
|
+
/** Bot API 9.6+: stable identifier for this option, since options can now be added/removed after the poll is sent. */
|
|
508
|
+
persistent_id?: string;
|
|
509
|
+
added_by_user?: User;
|
|
510
|
+
added_by_chat?: Chat;
|
|
511
|
+
addition_date?: Integer;
|
|
512
|
+
}
|
|
513
|
+
/** Bot API 9.6+ service message: a poll option was added after the poll was originally sent. */
|
|
514
|
+
export interface PollOptionAdded {
|
|
515
|
+
option: PollOption;
|
|
516
|
+
}
|
|
517
|
+
/** Bot API 9.6+ service message: a poll option was removed. */
|
|
518
|
+
export interface PollOptionDeleted {
|
|
519
|
+
option_persistent_id: string;
|
|
520
|
+
}
|
|
521
|
+
/** New in Bot API 10.x: polls can attach media/links to options. */
|
|
522
|
+
export interface PollMedia {
|
|
523
|
+
link?: Link;
|
|
524
|
+
photo?: PhotoSize[];
|
|
525
|
+
video?: Video;
|
|
526
|
+
}
|
|
527
|
+
export interface Link {
|
|
528
|
+
url: string;
|
|
529
|
+
title?: string;
|
|
530
|
+
}
|
|
531
|
+
export interface Dice {
|
|
532
|
+
emoji: string;
|
|
533
|
+
value: Integer;
|
|
534
|
+
}
|
|
535
|
+
export interface ReplyKeyboardMarkup {
|
|
536
|
+
keyboard: KeyboardButton[][];
|
|
537
|
+
is_persistent?: boolean;
|
|
538
|
+
resize_keyboard?: boolean;
|
|
539
|
+
one_time_keyboard?: boolean;
|
|
540
|
+
input_field_placeholder?: string;
|
|
541
|
+
selective?: boolean;
|
|
542
|
+
/** Bot API 10.3+: if set, the client will act as though the user has replied to a force reply. */
|
|
543
|
+
force_reply?: ForceReply;
|
|
544
|
+
}
|
|
545
|
+
export interface KeyboardButtonPollType {
|
|
546
|
+
type?: "quiz" | "regular";
|
|
547
|
+
}
|
|
548
|
+
export interface KeyboardButtonRequestUsers {
|
|
549
|
+
request_id: Integer;
|
|
550
|
+
user_is_bot?: boolean;
|
|
551
|
+
user_is_premium?: boolean;
|
|
552
|
+
max_quantity?: Integer;
|
|
553
|
+
request_name?: boolean;
|
|
554
|
+
request_username?: boolean;
|
|
555
|
+
request_photo?: boolean;
|
|
556
|
+
}
|
|
557
|
+
export interface KeyboardButtonRequestChat {
|
|
558
|
+
request_id: Integer;
|
|
559
|
+
chat_is_channel: boolean;
|
|
560
|
+
chat_is_forum?: boolean;
|
|
561
|
+
chat_has_username?: boolean;
|
|
562
|
+
chat_is_created?: boolean;
|
|
563
|
+
user_administrator_rights?: ChatAdministratorRights;
|
|
564
|
+
bot_administrator_rights?: ChatAdministratorRights;
|
|
565
|
+
bot_is_member?: boolean;
|
|
566
|
+
request_title?: boolean;
|
|
567
|
+
request_username?: boolean;
|
|
568
|
+
request_photo?: boolean;
|
|
569
|
+
}
|
|
570
|
+
/** Bot API 9.6+: lets a user, from a keyboard button, request creating a managed bot. */
|
|
571
|
+
export interface KeyboardButtonRequestManagedBot {
|
|
572
|
+
request_id: Integer;
|
|
573
|
+
user_id?: Integer;
|
|
574
|
+
}
|
|
575
|
+
export interface KeyboardButton {
|
|
576
|
+
text: string;
|
|
577
|
+
request_contact?: boolean;
|
|
578
|
+
request_location?: boolean;
|
|
579
|
+
request_poll?: KeyboardButtonPollType;
|
|
580
|
+
request_users?: KeyboardButtonRequestUsers;
|
|
581
|
+
/** @deprecated renamed to request_users — Telegram still honors this old name for backward compatibility. */
|
|
582
|
+
request_user?: KeyboardButtonRequestUsers;
|
|
583
|
+
request_chat?: KeyboardButtonRequestChat;
|
|
584
|
+
/** Bot API 9.6+ */
|
|
585
|
+
request_managed_bot?: KeyboardButtonRequestManagedBot;
|
|
586
|
+
web_app?: WebAppInfo;
|
|
587
|
+
icon_custom_emoji_id?: string;
|
|
588
|
+
style?: "primary" | "success" | "danger";
|
|
589
|
+
}
|
|
590
|
+
/** A static (.JPG) or animated (MPEG4) profile photo to set — used by setMyProfilePhoto / setBusinessAccountProfilePhoto. */
|
|
591
|
+
export type InputProfilePhoto = {
|
|
592
|
+
type: "static";
|
|
593
|
+
photo: InputFile;
|
|
594
|
+
} | {
|
|
595
|
+
type: "animated";
|
|
596
|
+
animation: InputFile;
|
|
597
|
+
main_frame_timestamp?: number;
|
|
598
|
+
};
|
|
599
|
+
export interface ReplyKeyboardRemove {
|
|
600
|
+
remove_keyboard: true;
|
|
601
|
+
selective?: boolean;
|
|
602
|
+
}
|
|
603
|
+
export interface ForceReply {
|
|
604
|
+
force_reply: true;
|
|
605
|
+
input_field_placeholder?: string;
|
|
606
|
+
selective?: boolean;
|
|
607
|
+
}
|
|
608
|
+
export interface InlineKeyboardMarkup {
|
|
609
|
+
inline_keyboard: InlineKeyboardButton[][];
|
|
610
|
+
/** Bot API 10.3+: if set, the client will act as though the user has replied to a force reply. */
|
|
611
|
+
force_reply?: ForceReply;
|
|
612
|
+
}
|
|
613
|
+
export interface CopyTextButton {
|
|
614
|
+
text: string;
|
|
615
|
+
}
|
|
616
|
+
/** Bot API 10.3+: information about the disabled state of an InlineKeyboardButton. */
|
|
617
|
+
export interface DisabledButton {
|
|
618
|
+
/** Alternative text shown instead of the original button text when the button is disabled. */
|
|
619
|
+
text?: string;
|
|
620
|
+
}
|
|
621
|
+
export interface SwitchInlineQueryChosenChat {
|
|
622
|
+
query?: string;
|
|
623
|
+
allow_user_chats?: boolean;
|
|
624
|
+
allow_bot_chats?: boolean;
|
|
625
|
+
allow_group_chats?: boolean;
|
|
626
|
+
allow_channel_chats?: boolean;
|
|
627
|
+
}
|
|
628
|
+
export interface InlineKeyboardButton {
|
|
629
|
+
text: string;
|
|
630
|
+
url?: string;
|
|
631
|
+
callback_data?: string;
|
|
632
|
+
web_app?: WebAppInfo;
|
|
633
|
+
login_url?: LoginUrl;
|
|
634
|
+
switch_inline_query?: string;
|
|
635
|
+
switch_inline_query_current_chat?: string;
|
|
636
|
+
switch_inline_query_chosen_chat?: SwitchInlineQueryChosenChat;
|
|
637
|
+
/** Bot API 7.11+: copies this text to the user's clipboard when tapped. */
|
|
638
|
+
copy_text?: CopyTextButton;
|
|
639
|
+
pay?: boolean;
|
|
640
|
+
icon_custom_emoji_id?: string;
|
|
641
|
+
style?: "primary" | "success" | "danger";
|
|
642
|
+
/** Bot API 10.3+: if set, the button is shown as disabled (greyed out, non-interactive). */
|
|
643
|
+
disabled?: DisabledButton;
|
|
644
|
+
}
|
|
645
|
+
export interface WebAppInfo {
|
|
646
|
+
url: string;
|
|
647
|
+
}
|
|
648
|
+
export interface LoginUrl {
|
|
649
|
+
url: string;
|
|
650
|
+
forward_text?: string;
|
|
651
|
+
bot_username?: string;
|
|
652
|
+
request_write_access?: boolean;
|
|
653
|
+
}
|
|
654
|
+
export type ReplyMarkup = InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
655
|
+
export type ParseMode = "MarkdownV2" | "HTML" | "Markdown";
|
|
656
|
+
/**
|
|
657
|
+
* Describes a rich message to send. Exactly one of `html` or `markdown` is
|
|
658
|
+
* used for text-based construction (Bot API 10.1); `blocks` is an alternative,
|
|
659
|
+
* structural way to build the same content directly (Bot API 10.2+).
|
|
660
|
+
*/
|
|
661
|
+
export interface InputRichMessage {
|
|
662
|
+
/** Content described using HTML formatting — mutually exclusive with markdown/blocks. */
|
|
663
|
+
html?: string;
|
|
664
|
+
/** Content described using Markdown formatting — mutually exclusive with html/blocks. */
|
|
665
|
+
markdown?: string;
|
|
666
|
+
/** Bot API 10.2+: build the message directly out of structured blocks instead of parsing markdown/HTML text. */
|
|
667
|
+
blocks?: InputRichBlock[];
|
|
668
|
+
/** Bot API 10.2+: media referenced by blocks (an alternative to inlining URLs directly in blocks). */
|
|
669
|
+
media?: InputRichMessageMedia[];
|
|
670
|
+
is_rtl?: boolean;
|
|
671
|
+
/** Skip auto-detection of URLs/emails/mentions/hashtags/cashtags/bot commands/phone numbers. */
|
|
672
|
+
skip_entity_detection?: boolean;
|
|
673
|
+
}
|
|
674
|
+
export interface InputRichMessageMedia {
|
|
675
|
+
/** Referenced by id from InputRichBlock's media variants (photo/video/audio/animation/voice_note/document) — confirmed required by a live "Can't find field 'id'" 400 from Telegram. */
|
|
676
|
+
id: string;
|
|
677
|
+
/** Bot API 10.3+: "document" added for tg://document?id= support in rich messages. */
|
|
678
|
+
type: "photo" | "video" | "audio" | "animation" | "voice_note" | "document";
|
|
679
|
+
media: InputFile;
|
|
680
|
+
}
|
|
681
|
+
/** Usable as InputMessageContent in inline/guest/Web App query results. */
|
|
682
|
+
export interface InputRichMessageContent {
|
|
683
|
+
rich_message: InputRichMessage;
|
|
684
|
+
}
|
|
685
|
+
/** The received counterpart of InputRichMessage — Message.rich_message has this type. */
|
|
686
|
+
export interface RichMessage {
|
|
687
|
+
blocks: RichBlock[];
|
|
688
|
+
/** Bot API 10.3+: buttons attached to this rich message. */
|
|
689
|
+
buttons?: RichMessageButton[];
|
|
690
|
+
is_rtl?: boolean;
|
|
691
|
+
}
|
|
692
|
+
/** Bot API 10.3+: a button attached to a RichMessage. */
|
|
693
|
+
export interface RichMessageButton {
|
|
694
|
+
text: string;
|
|
695
|
+
url?: string;
|
|
696
|
+
callback_data?: string;
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Rich formatted inline text: a plain string, an array of RichText
|
|
700
|
+
* (concatenation), or one of 25 tagged span types.
|
|
701
|
+
*/
|
|
702
|
+
export type RichText = string | RichText[] | RichTextTagged;
|
|
703
|
+
export type RichTextTagged = {
|
|
704
|
+
type: "bold";
|
|
705
|
+
text: RichText;
|
|
706
|
+
} | {
|
|
707
|
+
type: "italic";
|
|
708
|
+
text: RichText;
|
|
709
|
+
} | {
|
|
710
|
+
type: "underline";
|
|
711
|
+
text: RichText;
|
|
712
|
+
} | {
|
|
713
|
+
type: "strikethrough";
|
|
714
|
+
text: RichText;
|
|
715
|
+
} | {
|
|
716
|
+
type: "spoiler";
|
|
717
|
+
text: RichText;
|
|
718
|
+
} | {
|
|
719
|
+
type: "date_time";
|
|
720
|
+
text: RichText;
|
|
721
|
+
unix_time: Integer;
|
|
722
|
+
date_time_format: string;
|
|
723
|
+
} | {
|
|
724
|
+
type: "text_mention";
|
|
725
|
+
text: RichText;
|
|
726
|
+
user: User;
|
|
727
|
+
} | {
|
|
728
|
+
type: "subscript";
|
|
729
|
+
text: RichText;
|
|
730
|
+
} | {
|
|
731
|
+
type: "superscript";
|
|
732
|
+
text: RichText;
|
|
733
|
+
} | {
|
|
734
|
+
type: "marked";
|
|
735
|
+
text: RichText;
|
|
736
|
+
} | {
|
|
737
|
+
type: "code";
|
|
738
|
+
text: RichText;
|
|
739
|
+
} | {
|
|
740
|
+
type: "custom_emoji";
|
|
741
|
+
custom_emoji_id: string;
|
|
742
|
+
alternative_text: string;
|
|
743
|
+
} | {
|
|
744
|
+
type: "mathematical_expression";
|
|
745
|
+
expression: string;
|
|
746
|
+
} | {
|
|
747
|
+
type: "url";
|
|
748
|
+
text: RichText;
|
|
749
|
+
url: string;
|
|
750
|
+
} | {
|
|
751
|
+
type: "email_address";
|
|
752
|
+
text: RichText;
|
|
753
|
+
email_address: string;
|
|
754
|
+
} | {
|
|
755
|
+
type: "phone_number";
|
|
756
|
+
text: RichText;
|
|
757
|
+
phone_number: string;
|
|
758
|
+
} | {
|
|
759
|
+
type: "bank_card_number";
|
|
760
|
+
text: RichText;
|
|
761
|
+
bank_card_number: string;
|
|
762
|
+
} | {
|
|
763
|
+
type: "mention";
|
|
764
|
+
text: RichText;
|
|
765
|
+
username: string;
|
|
766
|
+
} | {
|
|
767
|
+
type: "hashtag";
|
|
768
|
+
text: RichText;
|
|
769
|
+
hashtag: string;
|
|
770
|
+
} | {
|
|
771
|
+
type: "cashtag";
|
|
772
|
+
text: RichText;
|
|
773
|
+
cashtag: string;
|
|
774
|
+
} | {
|
|
775
|
+
type: "bot_command";
|
|
776
|
+
text: RichText;
|
|
777
|
+
bot_command: string;
|
|
778
|
+
} | {
|
|
779
|
+
type: "anchor";
|
|
780
|
+
name: string;
|
|
781
|
+
} | {
|
|
782
|
+
type: "anchor_link";
|
|
783
|
+
text: RichText;
|
|
784
|
+
anchor_name: string;
|
|
785
|
+
} | {
|
|
786
|
+
type: "reference";
|
|
787
|
+
text: RichText;
|
|
788
|
+
name: string;
|
|
789
|
+
} | {
|
|
790
|
+
type: "reference_link";
|
|
791
|
+
text: RichText;
|
|
792
|
+
reference_name: string;
|
|
793
|
+
}
|
|
794
|
+
/** Bot API 10.3+: inline button within rich text. */
|
|
795
|
+
| {
|
|
796
|
+
type: "button";
|
|
797
|
+
text: RichText;
|
|
798
|
+
button: RichMessageButton;
|
|
799
|
+
};
|
|
800
|
+
/** Caption attached to a media/collage/slideshow/map block. */
|
|
801
|
+
export interface RichBlockCaption {
|
|
802
|
+
text: RichText;
|
|
803
|
+
credit?: RichText;
|
|
804
|
+
}
|
|
805
|
+
export interface RichBlockTableCell {
|
|
806
|
+
text?: RichText;
|
|
807
|
+
is_header?: true;
|
|
808
|
+
colspan?: Integer;
|
|
809
|
+
rowspan?: Integer;
|
|
810
|
+
align?: "left" | "center" | "right";
|
|
811
|
+
valign?: "top" | "middle" | "bottom";
|
|
812
|
+
}
|
|
813
|
+
export interface RichBlockListItem {
|
|
814
|
+
label?: string;
|
|
815
|
+
blocks: RichBlock[];
|
|
816
|
+
has_checkbox?: true;
|
|
817
|
+
is_checked?: true;
|
|
818
|
+
value?: Integer;
|
|
819
|
+
/** For ordered lists: "a" | "A" | "i" | "I" | "1" — see the official spec for what each renders as. */
|
|
820
|
+
type?: "a" | "A" | "i" | "I" | "1";
|
|
821
|
+
}
|
|
822
|
+
/** A block in a received rich formatted message — one of 21 types. */
|
|
823
|
+
export type RichBlock = {
|
|
824
|
+
type: "paragraph";
|
|
825
|
+
text: RichText;
|
|
826
|
+
} | {
|
|
827
|
+
type: "heading";
|
|
828
|
+
text: RichText;
|
|
829
|
+
size: Integer;
|
|
830
|
+
} | {
|
|
831
|
+
type: "pre";
|
|
832
|
+
text: RichText;
|
|
833
|
+
language?: string;
|
|
834
|
+
} | {
|
|
835
|
+
type: "footer";
|
|
836
|
+
text: RichText;
|
|
837
|
+
} | {
|
|
838
|
+
type: "divider";
|
|
839
|
+
} | {
|
|
840
|
+
type: "mathematical_expression";
|
|
841
|
+
expression: string;
|
|
842
|
+
} | {
|
|
843
|
+
type: "anchor";
|
|
844
|
+
name: string;
|
|
845
|
+
} | {
|
|
846
|
+
type: "list";
|
|
847
|
+
items: RichBlockListItem[];
|
|
848
|
+
} | {
|
|
849
|
+
type: "blockquote";
|
|
850
|
+
blocks: RichBlock[];
|
|
851
|
+
credit?: RichText;
|
|
852
|
+
} | {
|
|
853
|
+
type: "pullquote";
|
|
854
|
+
text: RichText;
|
|
855
|
+
credit?: RichText;
|
|
856
|
+
} | {
|
|
857
|
+
type: "collage";
|
|
858
|
+
blocks: RichBlock[];
|
|
859
|
+
caption?: RichBlockCaption;
|
|
860
|
+
} | {
|
|
861
|
+
type: "slideshow";
|
|
862
|
+
blocks: RichBlock[];
|
|
863
|
+
caption?: RichBlockCaption;
|
|
864
|
+
} | {
|
|
865
|
+
type: "table";
|
|
866
|
+
cells: RichBlockTableCell[][];
|
|
867
|
+
is_bordered?: true;
|
|
868
|
+
is_striped?: true; /** Bot API 10.3+ */
|
|
869
|
+
is_compact?: true;
|
|
870
|
+
caption?: RichText;
|
|
871
|
+
} | {
|
|
872
|
+
type: "details";
|
|
873
|
+
summary: RichText;
|
|
874
|
+
blocks: RichBlock[];
|
|
875
|
+
is_open?: true;
|
|
876
|
+
} | {
|
|
877
|
+
type: "map";
|
|
878
|
+
location: Location;
|
|
879
|
+
zoom: Integer;
|
|
880
|
+
width: Integer;
|
|
881
|
+
height: Integer;
|
|
882
|
+
caption?: RichBlockCaption;
|
|
883
|
+
} | {
|
|
884
|
+
type: "animation";
|
|
885
|
+
animation: Animation;
|
|
886
|
+
has_spoiler?: true;
|
|
887
|
+
caption?: RichBlockCaption;
|
|
888
|
+
} | {
|
|
889
|
+
type: "audio";
|
|
890
|
+
audio: Audio;
|
|
891
|
+
caption?: RichBlockCaption;
|
|
892
|
+
} | {
|
|
893
|
+
type: "photo";
|
|
894
|
+
photo: PhotoSize[];
|
|
895
|
+
has_spoiler?: true;
|
|
896
|
+
caption?: RichBlockCaption;
|
|
897
|
+
} | {
|
|
898
|
+
type: "video";
|
|
899
|
+
video: Video;
|
|
900
|
+
has_spoiler?: true;
|
|
901
|
+
caption?: RichBlockCaption;
|
|
902
|
+
} | {
|
|
903
|
+
type: "voice_note";
|
|
904
|
+
voice_note: Voice;
|
|
905
|
+
caption?: RichBlockCaption;
|
|
906
|
+
}
|
|
907
|
+
/** sendRichMessageDraft only — never appears in a received Message. */
|
|
908
|
+
| {
|
|
909
|
+
type: "thinking";
|
|
910
|
+
text: RichText;
|
|
911
|
+
}
|
|
912
|
+
/** Bot API 10.3+: row of buttons attached to the rich message. */
|
|
913
|
+
| {
|
|
914
|
+
type: "buttons";
|
|
915
|
+
buttons: RichMessageButton[];
|
|
916
|
+
}
|
|
917
|
+
/** Bot API 10.3+: a block quotation which can be expanded or collapsed. */
|
|
918
|
+
| {
|
|
919
|
+
type: "expandable_blockquote";
|
|
920
|
+
blocks: RichBlock[];
|
|
921
|
+
credit?: RichText;
|
|
922
|
+
}
|
|
923
|
+
/** Bot API 10.3+: a file (document) embedded in a rich message. */
|
|
924
|
+
| {
|
|
925
|
+
type: "document";
|
|
926
|
+
document: Document;
|
|
927
|
+
caption?: RichBlockCaption;
|
|
928
|
+
};
|
|
929
|
+
/**
|
|
930
|
+
* Input (send-side) counterpart of RichBlock for Bot API 10.2's block-based
|
|
931
|
+
* construction. Media blocks take an InputFile (URL/file_id/upload) instead
|
|
932
|
+
* of the receive-only PhotoSize[]/Video/Audio objects. Exact input field
|
|
933
|
+
* names for the media blocks weren't independently confirmed against two
|
|
934
|
+
* sources the way the rest of this file was — verify against
|
|
935
|
+
* core.telegram.org/bots/api if you rely on them heavily; the markdown/html
|
|
936
|
+
* text-based construction path (InputRichMessage.markdown / .html) is the
|
|
937
|
+
* more thoroughly-verified way to build media-containing rich messages.
|
|
938
|
+
*/
|
|
939
|
+
/** A reference to a media item declared in InputRichMessage.media, by its id — not an inline file. Confirmed by a live 400 ("Field must be of type Object") when an InputFile was sent directly instead. */
|
|
940
|
+
export interface InputRichMediaRef {
|
|
941
|
+
id: string;
|
|
942
|
+
}
|
|
943
|
+
export type InputRichBlock = {
|
|
944
|
+
type: "paragraph";
|
|
945
|
+
text: RichText;
|
|
946
|
+
} | {
|
|
947
|
+
type: "heading";
|
|
948
|
+
text: RichText;
|
|
949
|
+
size: Integer;
|
|
950
|
+
} | {
|
|
951
|
+
type: "pre";
|
|
952
|
+
text: RichText;
|
|
953
|
+
language?: string;
|
|
954
|
+
} | {
|
|
955
|
+
type: "footer";
|
|
956
|
+
text: RichText;
|
|
957
|
+
} | {
|
|
958
|
+
type: "divider";
|
|
959
|
+
} | {
|
|
960
|
+
type: "mathematical_expression";
|
|
961
|
+
expression: string;
|
|
962
|
+
} | {
|
|
963
|
+
type: "anchor";
|
|
964
|
+
name: string;
|
|
965
|
+
} | {
|
|
966
|
+
type: "list";
|
|
967
|
+
items: RichBlockListItem[];
|
|
968
|
+
} | {
|
|
969
|
+
type: "blockquote";
|
|
970
|
+
blocks: InputRichBlock[];
|
|
971
|
+
credit?: RichText;
|
|
972
|
+
} | {
|
|
973
|
+
type: "pullquote";
|
|
974
|
+
text: RichText;
|
|
975
|
+
credit?: RichText;
|
|
976
|
+
} | {
|
|
977
|
+
type: "collage";
|
|
978
|
+
blocks: InputRichBlock[];
|
|
979
|
+
caption?: RichBlockCaption;
|
|
980
|
+
} | {
|
|
981
|
+
type: "slideshow";
|
|
982
|
+
blocks: InputRichBlock[];
|
|
983
|
+
caption?: RichBlockCaption;
|
|
984
|
+
} | {
|
|
985
|
+
type: "table";
|
|
986
|
+
cells: RichBlockTableCell[][];
|
|
987
|
+
is_bordered?: true;
|
|
988
|
+
is_striped?: true; /** Bot API 10.3+ */
|
|
989
|
+
is_compact?: true;
|
|
990
|
+
caption?: RichText;
|
|
991
|
+
} | {
|
|
992
|
+
type: "details";
|
|
993
|
+
summary: RichText;
|
|
994
|
+
blocks: InputRichBlock[];
|
|
995
|
+
is_open?: true;
|
|
996
|
+
} | {
|
|
997
|
+
type: "map";
|
|
998
|
+
location: Location;
|
|
999
|
+
zoom: Integer;
|
|
1000
|
+
width: Integer;
|
|
1001
|
+
height: Integer;
|
|
1002
|
+
caption?: RichBlockCaption;
|
|
1003
|
+
} | {
|
|
1004
|
+
type: "animation";
|
|
1005
|
+
animation: InputRichMediaRef;
|
|
1006
|
+
has_spoiler?: true;
|
|
1007
|
+
caption?: RichBlockCaption;
|
|
1008
|
+
} | {
|
|
1009
|
+
type: "audio";
|
|
1010
|
+
audio: InputRichMediaRef;
|
|
1011
|
+
caption?: RichBlockCaption;
|
|
1012
|
+
} | {
|
|
1013
|
+
type: "photo";
|
|
1014
|
+
photo: InputRichMediaRef;
|
|
1015
|
+
has_spoiler?: true;
|
|
1016
|
+
caption?: RichBlockCaption;
|
|
1017
|
+
} | {
|
|
1018
|
+
type: "video";
|
|
1019
|
+
video: InputRichMediaRef;
|
|
1020
|
+
has_spoiler?: true;
|
|
1021
|
+
caption?: RichBlockCaption;
|
|
1022
|
+
} | {
|
|
1023
|
+
type: "voice_note";
|
|
1024
|
+
voice_note: InputRichMediaRef;
|
|
1025
|
+
caption?: RichBlockCaption;
|
|
1026
|
+
} | {
|
|
1027
|
+
type: "thinking";
|
|
1028
|
+
text: RichText;
|
|
1029
|
+
}
|
|
1030
|
+
/** Bot API 10.3+: row of buttons to send. */
|
|
1031
|
+
| {
|
|
1032
|
+
type: "buttons";
|
|
1033
|
+
buttons: RichMessageButton[];
|
|
1034
|
+
}
|
|
1035
|
+
/** Bot API 10.3+: an expandable/collapsible block quotation. */
|
|
1036
|
+
| {
|
|
1037
|
+
type: "expandable_blockquote";
|
|
1038
|
+
blocks: InputRichBlock[];
|
|
1039
|
+
credit?: RichText;
|
|
1040
|
+
}
|
|
1041
|
+
/** Bot API 10.3+: embed a document (file) in a rich message. */
|
|
1042
|
+
| {
|
|
1043
|
+
type: "document";
|
|
1044
|
+
document: InputRichMediaRef;
|
|
1045
|
+
caption?: RichBlockCaption;
|
|
1046
|
+
};
|
|
1047
|
+
/**
|
|
1048
|
+
* Bot API 10.3+: replaces the individual `receiver_user_id` and
|
|
1049
|
+
* `callback_query_id` parameters on send methods for ephemeral messages.
|
|
1050
|
+
* Pass this as `ephemeral_message_parameters` instead.
|
|
1051
|
+
*/
|
|
1052
|
+
export interface EphemeralMessageParameters {
|
|
1053
|
+
/** The user who will receive the ephemeral message. */
|
|
1054
|
+
receiver_user_id: Integer;
|
|
1055
|
+
/**
|
|
1056
|
+
* If set, the ephemeral message will be shown in place of the message
|
|
1057
|
+
* that triggered the callback query with this id.
|
|
1058
|
+
*/
|
|
1059
|
+
callback_query_id?: string;
|
|
1060
|
+
/** Bot API 10.3+: show the ephemeral message in place of the original message. */
|
|
1061
|
+
replace_callback_query_message?: boolean;
|
|
1062
|
+
}
|
|
1063
|
+
export interface Update {
|
|
1064
|
+
update_id: Integer;
|
|
1065
|
+
message?: Message;
|
|
1066
|
+
edited_message?: Message;
|
|
1067
|
+
channel_post?: Message;
|
|
1068
|
+
edited_channel_post?: Message;
|
|
1069
|
+
business_connection?: BusinessConnection;
|
|
1070
|
+
business_message?: Message;
|
|
1071
|
+
inline_query?: InlineQuery;
|
|
1072
|
+
chosen_inline_result?: ChosenInlineResult;
|
|
1073
|
+
callback_query?: CallbackQuery;
|
|
1074
|
+
shipping_query?: ShippingQuery;
|
|
1075
|
+
pre_checkout_query?: PreCheckoutQuery;
|
|
1076
|
+
poll?: Poll;
|
|
1077
|
+
poll_answer?: PollAnswer;
|
|
1078
|
+
my_chat_member?: ChatMemberUpdated;
|
|
1079
|
+
chat_member?: ChatMemberUpdated;
|
|
1080
|
+
chat_join_request?: ChatJoinRequest;
|
|
1081
|
+
subscription?: BotSubscriptionUpdated;
|
|
1082
|
+
managed_bot_created?: ManagedBotCreated;
|
|
1083
|
+
managed_bot?: ManagedBotUpdated;
|
|
1084
|
+
message_reaction?: MessageReactionUpdated;
|
|
1085
|
+
message_reaction_count?: MessageReactionCountUpdated;
|
|
1086
|
+
chat_boost?: ChatBoostUpdated;
|
|
1087
|
+
removed_chat_boost?: ChatBoostRemoved;
|
|
1088
|
+
/** Bot API 10.0+ (Guest mode): the bot was @mentioned in a chat it isn't a member of. Exact shape not independently verified beyond the fields below — verify against current docs. */
|
|
1089
|
+
guest_message?: GuestMessage;
|
|
1090
|
+
/** Bot API 10.3+: a user asked the bot to stop the generation of a message. */
|
|
1091
|
+
stopped_message_generation?: MessageGenerationStopped;
|
|
1092
|
+
}
|
|
1093
|
+
/** Bot API 10.3+: update received when a user stops message generation (e.g. presses the stop button while a draft is streaming). */
|
|
1094
|
+
export interface MessageGenerationStopped {
|
|
1095
|
+
chat: Chat;
|
|
1096
|
+
message_thread_id?: Integer;
|
|
1097
|
+
draft_id: Integer;
|
|
1098
|
+
from: User;
|
|
1099
|
+
date: Integer;
|
|
1100
|
+
}
|
|
1101
|
+
export interface GuestMessage {
|
|
1102
|
+
message: Message;
|
|
1103
|
+
guest_query_id?: string;
|
|
1104
|
+
[extra: string]: unknown;
|
|
1105
|
+
}
|
|
1106
|
+
/** Bot API 10.0+: settings a managing bot can view/configure for a managed bot it created. Exact fields not independently confirmed. */
|
|
1107
|
+
export interface BotAccessSettings {
|
|
1108
|
+
[key: string]: unknown;
|
|
1109
|
+
}
|
|
1110
|
+
export type UpdateType = keyof Omit<Update, "update_id">;
|
|
1111
|
+
/** Confirmed complete field list (python-telegram-bot v22.1+). What the bot is allowed to do on behalf of the connected business account. */
|
|
1112
|
+
export interface BusinessBotRights {
|
|
1113
|
+
can_reply?: boolean;
|
|
1114
|
+
can_read_messages?: boolean;
|
|
1115
|
+
can_delete_sent_messages?: boolean;
|
|
1116
|
+
/** @deprecated renamed to can_delete_sent_messages — kept only for reading old cached data. */
|
|
1117
|
+
can_delete_outgoing_messages?: boolean;
|
|
1118
|
+
can_delete_all_messages?: boolean;
|
|
1119
|
+
can_edit_name?: boolean;
|
|
1120
|
+
can_edit_bio?: boolean;
|
|
1121
|
+
can_edit_profile_photo?: boolean;
|
|
1122
|
+
can_edit_username?: boolean;
|
|
1123
|
+
can_change_gift_settings?: boolean;
|
|
1124
|
+
can_view_gifts_and_stars?: boolean;
|
|
1125
|
+
can_convert_gifts_to_stars?: boolean;
|
|
1126
|
+
can_transfer_and_upgrade_gifts?: boolean;
|
|
1127
|
+
can_transfer_stars?: boolean;
|
|
1128
|
+
can_manage_stories?: boolean;
|
|
1129
|
+
}
|
|
1130
|
+
export interface BusinessConnection {
|
|
1131
|
+
id: string;
|
|
1132
|
+
user: User;
|
|
1133
|
+
user_chat_id: Integer;
|
|
1134
|
+
date: Integer;
|
|
1135
|
+
rights?: BusinessBotRights;
|
|
1136
|
+
/** @deprecated replaced by rights.can_reply — kept for reading old cached data. */
|
|
1137
|
+
can_reply: boolean;
|
|
1138
|
+
is_enabled: boolean;
|
|
1139
|
+
}
|
|
1140
|
+
export interface BusinessIntro {
|
|
1141
|
+
title?: string;
|
|
1142
|
+
message?: string;
|
|
1143
|
+
sticker?: Sticker;
|
|
1144
|
+
}
|
|
1145
|
+
export interface BusinessLocation {
|
|
1146
|
+
address: string;
|
|
1147
|
+
location?: Location;
|
|
1148
|
+
}
|
|
1149
|
+
export interface BusinessOpeningHoursInterval {
|
|
1150
|
+
opening_minute: Integer;
|
|
1151
|
+
closing_minute: Integer;
|
|
1152
|
+
}
|
|
1153
|
+
export interface BusinessOpeningHours {
|
|
1154
|
+
time_zone_name: string;
|
|
1155
|
+
opening_hours: BusinessOpeningHoursInterval[];
|
|
1156
|
+
}
|
|
1157
|
+
export interface InlineQuery {
|
|
1158
|
+
id: string;
|
|
1159
|
+
from: User;
|
|
1160
|
+
query: string;
|
|
1161
|
+
offset: string;
|
|
1162
|
+
chat_type?: string;
|
|
1163
|
+
location?: Location;
|
|
1164
|
+
}
|
|
1165
|
+
export type InputMessageContent = InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent;
|
|
1166
|
+
export interface InputTextMessageContent {
|
|
1167
|
+
message_text: string;
|
|
1168
|
+
parse_mode?: ParseMode;
|
|
1169
|
+
entities?: MessageEntity[];
|
|
1170
|
+
link_preview_options?: LinkPreviewOptions;
|
|
1171
|
+
}
|
|
1172
|
+
export interface InputLocationMessageContent {
|
|
1173
|
+
latitude: number;
|
|
1174
|
+
longitude: number;
|
|
1175
|
+
horizontal_accuracy?: number;
|
|
1176
|
+
live_period?: Integer;
|
|
1177
|
+
heading?: Integer;
|
|
1178
|
+
proximity_alert_radius?: Integer;
|
|
1179
|
+
}
|
|
1180
|
+
export interface InputVenueMessageContent {
|
|
1181
|
+
latitude: number;
|
|
1182
|
+
longitude: number;
|
|
1183
|
+
title: string;
|
|
1184
|
+
address: string;
|
|
1185
|
+
foursquare_id?: string;
|
|
1186
|
+
foursquare_type?: string;
|
|
1187
|
+
google_place_id?: string;
|
|
1188
|
+
google_place_type?: string;
|
|
1189
|
+
}
|
|
1190
|
+
export interface InputContactMessageContent {
|
|
1191
|
+
phone_number: string;
|
|
1192
|
+
first_name: string;
|
|
1193
|
+
last_name?: string;
|
|
1194
|
+
vcard?: string;
|
|
1195
|
+
}
|
|
1196
|
+
export interface InputInvoiceMessageContent {
|
|
1197
|
+
title: string;
|
|
1198
|
+
description: string;
|
|
1199
|
+
payload: string;
|
|
1200
|
+
provider_token?: string;
|
|
1201
|
+
currency: string;
|
|
1202
|
+
prices: LabeledPrice[];
|
|
1203
|
+
max_tip_amount?: Integer;
|
|
1204
|
+
suggested_tip_amounts?: Integer[];
|
|
1205
|
+
provider_data?: string;
|
|
1206
|
+
photo_url?: string;
|
|
1207
|
+
photo_size?: Integer;
|
|
1208
|
+
photo_width?: Integer;
|
|
1209
|
+
photo_height?: Integer;
|
|
1210
|
+
need_name?: boolean;
|
|
1211
|
+
need_phone_number?: boolean;
|
|
1212
|
+
need_email?: boolean;
|
|
1213
|
+
need_shipping_address?: boolean;
|
|
1214
|
+
send_phone_number_to_provider?: boolean;
|
|
1215
|
+
send_email_to_provider?: boolean;
|
|
1216
|
+
is_flexible?: boolean;
|
|
1217
|
+
}
|
|
1218
|
+
interface InlineQueryResultBase {
|
|
1219
|
+
id: string;
|
|
1220
|
+
reply_markup?: InlineKeyboardMarkup;
|
|
1221
|
+
}
|
|
1222
|
+
export type InlineQueryResult = (InlineQueryResultBase & {
|
|
1223
|
+
type: "article";
|
|
1224
|
+
title: string;
|
|
1225
|
+
input_message_content: InputMessageContent;
|
|
1226
|
+
url?: string;
|
|
1227
|
+
description?: string;
|
|
1228
|
+
thumbnail_url?: string;
|
|
1229
|
+
thumbnail_width?: Integer;
|
|
1230
|
+
thumbnail_height?: Integer;
|
|
1231
|
+
}) | (InlineQueryResultBase & {
|
|
1232
|
+
type: "photo";
|
|
1233
|
+
photo_url: string;
|
|
1234
|
+
thumbnail_url: string;
|
|
1235
|
+
photo_width?: Integer;
|
|
1236
|
+
photo_height?: Integer;
|
|
1237
|
+
title?: string;
|
|
1238
|
+
description?: string;
|
|
1239
|
+
caption?: string;
|
|
1240
|
+
parse_mode?: ParseMode;
|
|
1241
|
+
caption_entities?: MessageEntity[];
|
|
1242
|
+
input_message_content?: InputMessageContent;
|
|
1243
|
+
}) | (InlineQueryResultBase & {
|
|
1244
|
+
type: "gif";
|
|
1245
|
+
gif_url: string;
|
|
1246
|
+
gif_width?: Integer;
|
|
1247
|
+
gif_height?: Integer;
|
|
1248
|
+
gif_duration?: Integer;
|
|
1249
|
+
thumbnail_url: string;
|
|
1250
|
+
thumbnail_mime_type?: string;
|
|
1251
|
+
title?: string;
|
|
1252
|
+
caption?: string;
|
|
1253
|
+
parse_mode?: ParseMode;
|
|
1254
|
+
caption_entities?: MessageEntity[];
|
|
1255
|
+
input_message_content?: InputMessageContent;
|
|
1256
|
+
}) | (InlineQueryResultBase & {
|
|
1257
|
+
type: "mpeg4_gif";
|
|
1258
|
+
mpeg4_url: string;
|
|
1259
|
+
mpeg4_width?: Integer;
|
|
1260
|
+
mpeg4_height?: Integer;
|
|
1261
|
+
mpeg4_duration?: Integer;
|
|
1262
|
+
thumbnail_url: string;
|
|
1263
|
+
thumbnail_mime_type?: string;
|
|
1264
|
+
title?: string;
|
|
1265
|
+
caption?: string;
|
|
1266
|
+
parse_mode?: ParseMode;
|
|
1267
|
+
caption_entities?: MessageEntity[];
|
|
1268
|
+
input_message_content?: InputMessageContent;
|
|
1269
|
+
}) | (InlineQueryResultBase & {
|
|
1270
|
+
type: "video";
|
|
1271
|
+
video_url: string;
|
|
1272
|
+
mime_type: string;
|
|
1273
|
+
thumbnail_url: string;
|
|
1274
|
+
title: string;
|
|
1275
|
+
caption?: string;
|
|
1276
|
+
parse_mode?: ParseMode;
|
|
1277
|
+
caption_entities?: MessageEntity[];
|
|
1278
|
+
video_width?: Integer;
|
|
1279
|
+
video_height?: Integer;
|
|
1280
|
+
video_duration?: Integer;
|
|
1281
|
+
description?: string;
|
|
1282
|
+
input_message_content?: InputMessageContent;
|
|
1283
|
+
}) | (InlineQueryResultBase & {
|
|
1284
|
+
type: "audio";
|
|
1285
|
+
audio_url: string;
|
|
1286
|
+
title: string;
|
|
1287
|
+
caption?: string;
|
|
1288
|
+
parse_mode?: ParseMode;
|
|
1289
|
+
caption_entities?: MessageEntity[];
|
|
1290
|
+
performer?: string;
|
|
1291
|
+
audio_duration?: Integer;
|
|
1292
|
+
input_message_content?: InputMessageContent;
|
|
1293
|
+
}) | (InlineQueryResultBase & {
|
|
1294
|
+
type: "voice";
|
|
1295
|
+
voice_url: string;
|
|
1296
|
+
title: string;
|
|
1297
|
+
caption?: string;
|
|
1298
|
+
parse_mode?: ParseMode;
|
|
1299
|
+
caption_entities?: MessageEntity[];
|
|
1300
|
+
voice_duration?: Integer;
|
|
1301
|
+
input_message_content?: InputMessageContent;
|
|
1302
|
+
}) | (InlineQueryResultBase & {
|
|
1303
|
+
type: "document";
|
|
1304
|
+
title: string;
|
|
1305
|
+
caption?: string;
|
|
1306
|
+
parse_mode?: ParseMode;
|
|
1307
|
+
caption_entities?: MessageEntity[];
|
|
1308
|
+
document_url: string;
|
|
1309
|
+
mime_type: string;
|
|
1310
|
+
description?: string;
|
|
1311
|
+
thumbnail_url?: string;
|
|
1312
|
+
thumbnail_width?: Integer;
|
|
1313
|
+
thumbnail_height?: Integer;
|
|
1314
|
+
input_message_content?: InputMessageContent;
|
|
1315
|
+
}) | (InlineQueryResultBase & {
|
|
1316
|
+
type: "location";
|
|
1317
|
+
latitude: number;
|
|
1318
|
+
longitude: number;
|
|
1319
|
+
title: string;
|
|
1320
|
+
horizontal_accuracy?: number;
|
|
1321
|
+
live_period?: Integer;
|
|
1322
|
+
heading?: Integer;
|
|
1323
|
+
proximity_alert_radius?: Integer;
|
|
1324
|
+
thumbnail_url?: string;
|
|
1325
|
+
thumbnail_width?: Integer;
|
|
1326
|
+
thumbnail_height?: Integer;
|
|
1327
|
+
input_message_content?: InputMessageContent;
|
|
1328
|
+
}) | (InlineQueryResultBase & {
|
|
1329
|
+
type: "venue";
|
|
1330
|
+
latitude: number;
|
|
1331
|
+
longitude: number;
|
|
1332
|
+
title: string;
|
|
1333
|
+
address: string;
|
|
1334
|
+
foursquare_id?: string;
|
|
1335
|
+
foursquare_type?: string;
|
|
1336
|
+
google_place_id?: string;
|
|
1337
|
+
google_place_type?: string;
|
|
1338
|
+
thumbnail_url?: string;
|
|
1339
|
+
thumbnail_width?: Integer;
|
|
1340
|
+
thumbnail_height?: Integer;
|
|
1341
|
+
input_message_content?: InputMessageContent;
|
|
1342
|
+
}) | (InlineQueryResultBase & {
|
|
1343
|
+
type: "contact";
|
|
1344
|
+
phone_number: string;
|
|
1345
|
+
first_name: string;
|
|
1346
|
+
last_name?: string;
|
|
1347
|
+
vcard?: string;
|
|
1348
|
+
thumbnail_url?: string;
|
|
1349
|
+
thumbnail_width?: Integer;
|
|
1350
|
+
thumbnail_height?: Integer;
|
|
1351
|
+
input_message_content?: InputMessageContent;
|
|
1352
|
+
}) | (InlineQueryResultBase & {
|
|
1353
|
+
type: "game";
|
|
1354
|
+
game_short_name: string;
|
|
1355
|
+
}) | (InlineQueryResultBase & {
|
|
1356
|
+
type: "sticker";
|
|
1357
|
+
sticker_file_id: string;
|
|
1358
|
+
input_message_content?: InputMessageContent;
|
|
1359
|
+
}) | (InlineQueryResultBase & {
|
|
1360
|
+
type: "photo";
|
|
1361
|
+
photo_file_id: string;
|
|
1362
|
+
title?: string;
|
|
1363
|
+
description?: string;
|
|
1364
|
+
caption?: string;
|
|
1365
|
+
parse_mode?: ParseMode;
|
|
1366
|
+
caption_entities?: MessageEntity[];
|
|
1367
|
+
input_message_content?: InputMessageContent;
|
|
1368
|
+
}) | (InlineQueryResultBase & {
|
|
1369
|
+
type: "gif";
|
|
1370
|
+
gif_file_id: string;
|
|
1371
|
+
title?: string;
|
|
1372
|
+
caption?: string;
|
|
1373
|
+
parse_mode?: ParseMode;
|
|
1374
|
+
caption_entities?: MessageEntity[];
|
|
1375
|
+
input_message_content?: InputMessageContent;
|
|
1376
|
+
}) | (InlineQueryResultBase & {
|
|
1377
|
+
type: "mpeg4_gif";
|
|
1378
|
+
mpeg4_file_id: string;
|
|
1379
|
+
title?: string;
|
|
1380
|
+
caption?: string;
|
|
1381
|
+
parse_mode?: ParseMode;
|
|
1382
|
+
caption_entities?: MessageEntity[];
|
|
1383
|
+
input_message_content?: InputMessageContent;
|
|
1384
|
+
}) | (InlineQueryResultBase & {
|
|
1385
|
+
type: "video";
|
|
1386
|
+
video_file_id: string;
|
|
1387
|
+
title: string;
|
|
1388
|
+
description?: string;
|
|
1389
|
+
caption?: string;
|
|
1390
|
+
parse_mode?: ParseMode;
|
|
1391
|
+
caption_entities?: MessageEntity[];
|
|
1392
|
+
input_message_content?: InputMessageContent;
|
|
1393
|
+
}) | (InlineQueryResultBase & {
|
|
1394
|
+
type: "audio";
|
|
1395
|
+
audio_file_id: string;
|
|
1396
|
+
caption?: string;
|
|
1397
|
+
parse_mode?: ParseMode;
|
|
1398
|
+
caption_entities?: MessageEntity[];
|
|
1399
|
+
input_message_content?: InputMessageContent;
|
|
1400
|
+
}) | (InlineQueryResultBase & {
|
|
1401
|
+
type: "voice";
|
|
1402
|
+
voice_file_id: string;
|
|
1403
|
+
title: string;
|
|
1404
|
+
caption?: string;
|
|
1405
|
+
parse_mode?: ParseMode;
|
|
1406
|
+
caption_entities?: MessageEntity[];
|
|
1407
|
+
input_message_content?: InputMessageContent;
|
|
1408
|
+
}) | (InlineQueryResultBase & {
|
|
1409
|
+
type: "document";
|
|
1410
|
+
document_file_id: string;
|
|
1411
|
+
title: string;
|
|
1412
|
+
description?: string;
|
|
1413
|
+
caption?: string;
|
|
1414
|
+
parse_mode?: ParseMode;
|
|
1415
|
+
caption_entities?: MessageEntity[];
|
|
1416
|
+
input_message_content?: InputMessageContent;
|
|
1417
|
+
}) | (InlineQueryResultBase & {
|
|
1418
|
+
type: "sticker";
|
|
1419
|
+
sticker_file_id: string;
|
|
1420
|
+
});
|
|
1421
|
+
/** What a Mini App got back after saving a message via savePreparedInlineMessage. */
|
|
1422
|
+
export interface PreparedInlineMessage {
|
|
1423
|
+
id: string;
|
|
1424
|
+
expiration_date: Integer;
|
|
1425
|
+
}
|
|
1426
|
+
export interface InlineQueryResultsButton {
|
|
1427
|
+
text: string;
|
|
1428
|
+
web_app?: WebAppInfo;
|
|
1429
|
+
start_parameter?: string;
|
|
1430
|
+
}
|
|
1431
|
+
export interface ChosenInlineResult {
|
|
1432
|
+
result_id: string;
|
|
1433
|
+
from: User;
|
|
1434
|
+
location?: Location;
|
|
1435
|
+
inline_message_id?: string;
|
|
1436
|
+
query: string;
|
|
1437
|
+
}
|
|
1438
|
+
export interface CallbackQuery {
|
|
1439
|
+
id: string;
|
|
1440
|
+
from: User;
|
|
1441
|
+
message?: MaybeInaccessibleMessage;
|
|
1442
|
+
inline_message_id?: string;
|
|
1443
|
+
chat_instance: string;
|
|
1444
|
+
data?: string;
|
|
1445
|
+
game_short_name?: string;
|
|
1446
|
+
}
|
|
1447
|
+
export interface ShippingQuery {
|
|
1448
|
+
id: string;
|
|
1449
|
+
from: User;
|
|
1450
|
+
invoice_payload: string;
|
|
1451
|
+
shipping_address: ShippingAddress;
|
|
1452
|
+
}
|
|
1453
|
+
export interface ShippingAddress {
|
|
1454
|
+
country_code: string;
|
|
1455
|
+
state: string;
|
|
1456
|
+
city: string;
|
|
1457
|
+
street_line1: string;
|
|
1458
|
+
street_line2: string;
|
|
1459
|
+
post_code: string;
|
|
1460
|
+
}
|
|
1461
|
+
export interface LabeledPrice {
|
|
1462
|
+
label: string;
|
|
1463
|
+
amount: Integer;
|
|
1464
|
+
}
|
|
1465
|
+
export interface ShippingOption {
|
|
1466
|
+
id: string;
|
|
1467
|
+
title: string;
|
|
1468
|
+
prices: LabeledPrice[];
|
|
1469
|
+
}
|
|
1470
|
+
export interface OrderInfo {
|
|
1471
|
+
name?: string;
|
|
1472
|
+
phone_number?: string;
|
|
1473
|
+
email?: string;
|
|
1474
|
+
shipping_address?: ShippingAddress;
|
|
1475
|
+
}
|
|
1476
|
+
export interface SuccessfulPayment {
|
|
1477
|
+
currency: string;
|
|
1478
|
+
total_amount: Integer;
|
|
1479
|
+
invoice_payload: string;
|
|
1480
|
+
subscription_expiration_date?: Integer;
|
|
1481
|
+
is_recurring?: boolean;
|
|
1482
|
+
is_first_recurring?: boolean;
|
|
1483
|
+
shipping_option_id?: string;
|
|
1484
|
+
order_info?: OrderInfo;
|
|
1485
|
+
telegram_payment_charge_id: string;
|
|
1486
|
+
provider_payment_charge_id: string;
|
|
1487
|
+
}
|
|
1488
|
+
export interface PreCheckoutQuery {
|
|
1489
|
+
id: string;
|
|
1490
|
+
from: User;
|
|
1491
|
+
currency: string;
|
|
1492
|
+
total_amount: Integer;
|
|
1493
|
+
invoice_payload: string;
|
|
1494
|
+
shipping_option_id?: string;
|
|
1495
|
+
order_info?: OrderInfo;
|
|
1496
|
+
}
|
|
1497
|
+
export interface Invoice {
|
|
1498
|
+
title: string;
|
|
1499
|
+
description: string;
|
|
1500
|
+
start_parameter: string;
|
|
1501
|
+
currency: string;
|
|
1502
|
+
total_amount: Integer;
|
|
1503
|
+
}
|
|
1504
|
+
export interface GameHighScore {
|
|
1505
|
+
position: Integer;
|
|
1506
|
+
user: User;
|
|
1507
|
+
score: Integer;
|
|
1508
|
+
}
|
|
1509
|
+
export type BotCommandScope = {
|
|
1510
|
+
type: "default";
|
|
1511
|
+
} | {
|
|
1512
|
+
type: "all_private_chats";
|
|
1513
|
+
} | {
|
|
1514
|
+
type: "all_group_chats";
|
|
1515
|
+
} | {
|
|
1516
|
+
type: "all_chat_administrators";
|
|
1517
|
+
} | {
|
|
1518
|
+
type: "chat";
|
|
1519
|
+
chat_id: ChatId;
|
|
1520
|
+
} | {
|
|
1521
|
+
type: "chat_administrators";
|
|
1522
|
+
chat_id: ChatId;
|
|
1523
|
+
} | {
|
|
1524
|
+
type: "chat_member";
|
|
1525
|
+
chat_id: ChatId;
|
|
1526
|
+
user_id: Integer;
|
|
1527
|
+
};
|
|
1528
|
+
export type MenuButton = {
|
|
1529
|
+
type: "default";
|
|
1530
|
+
} | {
|
|
1531
|
+
type: "commands";
|
|
1532
|
+
} | {
|
|
1533
|
+
type: "web_app";
|
|
1534
|
+
text: string;
|
|
1535
|
+
web_app: WebAppInfo;
|
|
1536
|
+
};
|
|
1537
|
+
export interface MaskPosition {
|
|
1538
|
+
point: "forehead" | "eyes" | "mouth" | "chin";
|
|
1539
|
+
x_shift: number;
|
|
1540
|
+
y_shift: number;
|
|
1541
|
+
scale: number;
|
|
1542
|
+
}
|
|
1543
|
+
export interface InputSticker {
|
|
1544
|
+
sticker: InputFile;
|
|
1545
|
+
format: "static" | "animated" | "video";
|
|
1546
|
+
emoji_list: string[];
|
|
1547
|
+
mask_position?: MaskPosition;
|
|
1548
|
+
keywords?: string[];
|
|
1549
|
+
}
|
|
1550
|
+
export interface ChatAdministratorRights {
|
|
1551
|
+
is_anonymous: boolean;
|
|
1552
|
+
can_manage_chat: boolean;
|
|
1553
|
+
can_delete_messages: boolean;
|
|
1554
|
+
can_manage_video_chats: boolean;
|
|
1555
|
+
can_restrict_members: boolean;
|
|
1556
|
+
can_promote_members: boolean;
|
|
1557
|
+
can_change_info: boolean;
|
|
1558
|
+
can_invite_users: boolean;
|
|
1559
|
+
can_post_messages?: boolean;
|
|
1560
|
+
can_edit_messages?: boolean;
|
|
1561
|
+
can_pin_messages?: boolean;
|
|
1562
|
+
can_post_stories?: boolean;
|
|
1563
|
+
can_edit_stories?: boolean;
|
|
1564
|
+
can_delete_stories?: boolean;
|
|
1565
|
+
can_manage_topics?: boolean;
|
|
1566
|
+
/** Bot API 9.2+ */
|
|
1567
|
+
can_manage_direct_messages?: boolean;
|
|
1568
|
+
/** Bot API 9.5+ */
|
|
1569
|
+
can_manage_tags?: boolean;
|
|
1570
|
+
/** Bot API 10.3+: whether the administrator can send welcome messages (ephemeral messages sent to new members). */
|
|
1571
|
+
can_send_welcome_messages?: boolean;
|
|
1572
|
+
}
|
|
1573
|
+
export interface SentWebAppMessage {
|
|
1574
|
+
inline_message_id?: string;
|
|
1575
|
+
}
|
|
1576
|
+
export interface PassportFile {
|
|
1577
|
+
file_id: FileId;
|
|
1578
|
+
file_unique_id: string;
|
|
1579
|
+
file_size: Integer;
|
|
1580
|
+
file_date: Integer;
|
|
1581
|
+
}
|
|
1582
|
+
export type PassportElementType = "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" | "phone_number" | "email";
|
|
1583
|
+
export interface EncryptedPassportElement {
|
|
1584
|
+
type: PassportElementType;
|
|
1585
|
+
data?: string;
|
|
1586
|
+
phone_number?: string;
|
|
1587
|
+
email?: string;
|
|
1588
|
+
files?: PassportFile[];
|
|
1589
|
+
front_side?: PassportFile;
|
|
1590
|
+
reverse_side?: PassportFile;
|
|
1591
|
+
selfie?: PassportFile;
|
|
1592
|
+
translation?: PassportFile[];
|
|
1593
|
+
hash: string;
|
|
1594
|
+
}
|
|
1595
|
+
export interface EncryptedCredentials {
|
|
1596
|
+
data: string;
|
|
1597
|
+
hash: string;
|
|
1598
|
+
secret: string;
|
|
1599
|
+
}
|
|
1600
|
+
export interface PassportData {
|
|
1601
|
+
data: EncryptedPassportElement[];
|
|
1602
|
+
credentials: EncryptedCredentials;
|
|
1603
|
+
}
|
|
1604
|
+
/** Reported via setPassportDataErrors when a submitted Passport element fails your validation. */
|
|
1605
|
+
export type PassportElementError = {
|
|
1606
|
+
source: "data";
|
|
1607
|
+
type: PassportElementType;
|
|
1608
|
+
field_name: string;
|
|
1609
|
+
data_hash: string;
|
|
1610
|
+
message: string;
|
|
1611
|
+
} | {
|
|
1612
|
+
source: "front_side";
|
|
1613
|
+
type: PassportElementType;
|
|
1614
|
+
file_hash: string;
|
|
1615
|
+
message: string;
|
|
1616
|
+
} | {
|
|
1617
|
+
source: "reverse_side";
|
|
1618
|
+
type: PassportElementType;
|
|
1619
|
+
file_hash: string;
|
|
1620
|
+
message: string;
|
|
1621
|
+
} | {
|
|
1622
|
+
source: "selfie";
|
|
1623
|
+
type: PassportElementType;
|
|
1624
|
+
file_hash: string;
|
|
1625
|
+
message: string;
|
|
1626
|
+
} | {
|
|
1627
|
+
source: "file";
|
|
1628
|
+
type: PassportElementType;
|
|
1629
|
+
file_hash: string;
|
|
1630
|
+
message: string;
|
|
1631
|
+
} | {
|
|
1632
|
+
source: "files";
|
|
1633
|
+
type: PassportElementType;
|
|
1634
|
+
file_hashes: string[];
|
|
1635
|
+
message: string;
|
|
1636
|
+
} | {
|
|
1637
|
+
source: "translation_file";
|
|
1638
|
+
type: PassportElementType;
|
|
1639
|
+
file_hash: string;
|
|
1640
|
+
message: string;
|
|
1641
|
+
} | {
|
|
1642
|
+
source: "translation_files";
|
|
1643
|
+
type: PassportElementType;
|
|
1644
|
+
file_hashes: string[];
|
|
1645
|
+
message: string;
|
|
1646
|
+
} | {
|
|
1647
|
+
source: "unspecified";
|
|
1648
|
+
type: PassportElementType;
|
|
1649
|
+
element_hash: string;
|
|
1650
|
+
message: string;
|
|
1651
|
+
};
|
|
1652
|
+
export interface PollAnswer {
|
|
1653
|
+
poll_id: string;
|
|
1654
|
+
voter_chat?: Chat;
|
|
1655
|
+
user?: User;
|
|
1656
|
+
option_ids: Integer[];
|
|
1657
|
+
/** Bot API 9.6+: stable identifiers for the chosen options, since options can now be added/removed after the poll is sent. */
|
|
1658
|
+
option_persistent_ids?: string[];
|
|
1659
|
+
}
|
|
1660
|
+
export interface ChatMemberUpdated {
|
|
1661
|
+
chat: Chat;
|
|
1662
|
+
from: User;
|
|
1663
|
+
date: Integer;
|
|
1664
|
+
old_chat_member: ChatMember;
|
|
1665
|
+
new_chat_member: ChatMember;
|
|
1666
|
+
invite_link?: ChatInviteLink;
|
|
1667
|
+
}
|
|
1668
|
+
export interface ChatMember {
|
|
1669
|
+
status: "creator" | "administrator" | "member" | "restricted" | "left" | "kicked";
|
|
1670
|
+
user: User;
|
|
1671
|
+
is_anonymous?: boolean;
|
|
1672
|
+
until_date?: Integer;
|
|
1673
|
+
/** Bot API 9.5+: this member's tag, in chats that have tags enabled. */
|
|
1674
|
+
tag?: string;
|
|
1675
|
+
/** Bot API 10.3+: administrator-only — whether this admin can send welcome messages. */
|
|
1676
|
+
can_send_welcome_messages?: boolean;
|
|
1677
|
+
}
|
|
1678
|
+
export interface ChatInviteLink {
|
|
1679
|
+
invite_link: string;
|
|
1680
|
+
creator: User;
|
|
1681
|
+
creates_join_request: boolean;
|
|
1682
|
+
is_primary: boolean;
|
|
1683
|
+
is_revoked: boolean;
|
|
1684
|
+
name?: string;
|
|
1685
|
+
expire_date?: Integer;
|
|
1686
|
+
member_limit?: Integer;
|
|
1687
|
+
}
|
|
1688
|
+
export interface ChatJoinRequest {
|
|
1689
|
+
chat: Chat;
|
|
1690
|
+
from: User;
|
|
1691
|
+
user_chat_id: Integer;
|
|
1692
|
+
date: Integer;
|
|
1693
|
+
bio?: string;
|
|
1694
|
+
invite_link?: ChatInviteLink;
|
|
1695
|
+
query_id?: string;
|
|
1696
|
+
}
|
|
1697
|
+
/** New in Bot API 10.x — payment subscription state changes. */
|
|
1698
|
+
export interface BotSubscriptionUpdated {
|
|
1699
|
+
user: User;
|
|
1700
|
+
is_active: boolean;
|
|
1701
|
+
subscription_period: Integer;
|
|
1702
|
+
}
|
|
1703
|
+
/** New in Bot API 9.5/9.6 — bots creating and managing child bots. */
|
|
1704
|
+
export interface ManagedBotCreated {
|
|
1705
|
+
bot: User;
|
|
1706
|
+
manager_bot: User;
|
|
1707
|
+
}
|
|
1708
|
+
export interface ManagedBotUpdated {
|
|
1709
|
+
bot: User;
|
|
1710
|
+
manager_bot: User;
|
|
1711
|
+
field: string;
|
|
1712
|
+
}
|
|
1713
|
+
export interface File {
|
|
1714
|
+
file_id: FileId;
|
|
1715
|
+
file_unique_id: string;
|
|
1716
|
+
file_size?: Integer;
|
|
1717
|
+
file_path?: string;
|
|
1718
|
+
}
|
|
1719
|
+
/** Anything tgplus accepts as an "input file": a file_id, a URL, a Buffer, a real Node stream, or a local file path — all streamed to Telegram without buffering the whole file in memory except for Buffer sources (which are already fully in memory by definition). */
|
|
1720
|
+
export type InputFile = FileId | {
|
|
1721
|
+
url: string;
|
|
1722
|
+
} | {
|
|
1723
|
+
source: Buffer | NodeJS.ReadableStream;
|
|
1724
|
+
filename: string;
|
|
1725
|
+
} | {
|
|
1726
|
+
source: string;
|
|
1727
|
+
filename?: string;
|
|
1728
|
+
};
|
|
1729
|
+
export interface InputMediaBase {
|
|
1730
|
+
type: "photo" | "video" | "animation" | "audio" | "document";
|
|
1731
|
+
media: InputFile;
|
|
1732
|
+
caption?: string;
|
|
1733
|
+
parse_mode?: ParseMode;
|
|
1734
|
+
}
|
|
1735
|
+
export interface InputMediaPhoto extends InputMediaBase {
|
|
1736
|
+
type: "photo";
|
|
1737
|
+
has_spoiler?: boolean;
|
|
1738
|
+
show_caption_above_media?: boolean;
|
|
1739
|
+
}
|
|
1740
|
+
export interface InputMediaVideo extends InputMediaBase {
|
|
1741
|
+
type: "video";
|
|
1742
|
+
width?: Integer;
|
|
1743
|
+
height?: Integer;
|
|
1744
|
+
duration?: Integer;
|
|
1745
|
+
has_spoiler?: boolean;
|
|
1746
|
+
show_caption_above_media?: boolean;
|
|
1747
|
+
supports_streaming?: boolean;
|
|
1748
|
+
/** Bot API 8.3+: a cover image for the video, shown before playback. */
|
|
1749
|
+
cover?: InputFile;
|
|
1750
|
+
/** Bot API 8.3+: timestamp (seconds) from which playback starts. */
|
|
1751
|
+
start_timestamp?: Integer;
|
|
1752
|
+
}
|
|
1753
|
+
export interface InputMediaAnimation extends InputMediaBase {
|
|
1754
|
+
type: "animation";
|
|
1755
|
+
width?: Integer;
|
|
1756
|
+
height?: Integer;
|
|
1757
|
+
duration?: Integer;
|
|
1758
|
+
has_spoiler?: boolean;
|
|
1759
|
+
show_caption_above_media?: boolean;
|
|
1760
|
+
}
|
|
1761
|
+
export interface InputMediaAudio extends InputMediaBase {
|
|
1762
|
+
type: "audio";
|
|
1763
|
+
duration?: Integer;
|
|
1764
|
+
performer?: string;
|
|
1765
|
+
title?: string;
|
|
1766
|
+
}
|
|
1767
|
+
export interface InputMediaDocument extends InputMediaBase {
|
|
1768
|
+
type: "document";
|
|
1769
|
+
}
|
|
1770
|
+
export interface InputMediaVoiceNote {
|
|
1771
|
+
type: "voice_note";
|
|
1772
|
+
media: InputFile;
|
|
1773
|
+
caption?: string;
|
|
1774
|
+
parse_mode?: ParseMode;
|
|
1775
|
+
duration?: Integer;
|
|
1776
|
+
}
|
|
1777
|
+
export interface InputMediaSticker {
|
|
1778
|
+
type: "sticker";
|
|
1779
|
+
media: InputFile;
|
|
1780
|
+
}
|
|
1781
|
+
export interface InputMediaLocation {
|
|
1782
|
+
type: "location";
|
|
1783
|
+
latitude: number;
|
|
1784
|
+
longitude: number;
|
|
1785
|
+
}
|
|
1786
|
+
export interface InputMediaVenue {
|
|
1787
|
+
type: "venue";
|
|
1788
|
+
latitude: number;
|
|
1789
|
+
longitude: number;
|
|
1790
|
+
title: string;
|
|
1791
|
+
address: string;
|
|
1792
|
+
}
|
|
1793
|
+
export interface InputMediaLink {
|
|
1794
|
+
type: "link";
|
|
1795
|
+
link: Link;
|
|
1796
|
+
}
|
|
1797
|
+
export interface InputMediaLivePhoto {
|
|
1798
|
+
type: "live_photo";
|
|
1799
|
+
media: InputFile;
|
|
1800
|
+
caption?: string;
|
|
1801
|
+
parse_mode?: ParseMode;
|
|
1802
|
+
has_spoiler?: boolean;
|
|
1803
|
+
show_caption_above_media?: boolean;
|
|
1804
|
+
}
|
|
1805
|
+
export type InputMedia = InputMediaPhoto | InputMediaVideo | InputMediaAnimation | InputMediaAudio | InputMediaDocument | InputMediaLivePhoto;
|
|
1806
|
+
export interface PaidMediaInfo {
|
|
1807
|
+
star_count: Integer;
|
|
1808
|
+
paid_media: PaidMedia[];
|
|
1809
|
+
}
|
|
1810
|
+
export type PaidMedia = {
|
|
1811
|
+
type: "preview";
|
|
1812
|
+
width?: Integer;
|
|
1813
|
+
height?: Integer;
|
|
1814
|
+
duration?: Integer;
|
|
1815
|
+
} | {
|
|
1816
|
+
type: "photo";
|
|
1817
|
+
photo: PhotoSize[];
|
|
1818
|
+
} | {
|
|
1819
|
+
type: "video";
|
|
1820
|
+
video: Video;
|
|
1821
|
+
} | {
|
|
1822
|
+
type: "live_photo";
|
|
1823
|
+
live_photo: LivePhoto;
|
|
1824
|
+
};
|
|
1825
|
+
export type InputPaidMedia = InputPaidMediaPhoto | InputPaidMediaVideo | InputPaidMediaLivePhoto;
|
|
1826
|
+
export interface InputPaidMediaLivePhoto {
|
|
1827
|
+
type: "live_photo";
|
|
1828
|
+
media: InputFile;
|
|
1829
|
+
}
|
|
1830
|
+
export interface InputPaidMediaPhoto {
|
|
1831
|
+
type: "photo";
|
|
1832
|
+
media: InputFile;
|
|
1833
|
+
}
|
|
1834
|
+
export interface InputPaidMediaVideo {
|
|
1835
|
+
type: "video";
|
|
1836
|
+
media: InputFile;
|
|
1837
|
+
width?: Integer;
|
|
1838
|
+
height?: Integer;
|
|
1839
|
+
duration?: Integer;
|
|
1840
|
+
supports_streaming?: boolean;
|
|
1841
|
+
cover?: InputFile;
|
|
1842
|
+
start_timestamp?: Integer;
|
|
1843
|
+
}
|
|
1844
|
+
export interface ReactionTypeEmoji {
|
|
1845
|
+
type: "emoji";
|
|
1846
|
+
emoji: string;
|
|
1847
|
+
}
|
|
1848
|
+
export interface ReactionTypeCustomEmoji {
|
|
1849
|
+
type: "custom_emoji";
|
|
1850
|
+
custom_emoji_id: string;
|
|
1851
|
+
}
|
|
1852
|
+
export interface ReactionTypePaid {
|
|
1853
|
+
type: "paid";
|
|
1854
|
+
}
|
|
1855
|
+
export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid;
|
|
1856
|
+
export interface MessageReactionUpdated {
|
|
1857
|
+
chat: Chat;
|
|
1858
|
+
message_id: Integer;
|
|
1859
|
+
user?: User;
|
|
1860
|
+
actor_chat?: Chat;
|
|
1861
|
+
date: Integer;
|
|
1862
|
+
old_reaction: ReactionType[];
|
|
1863
|
+
new_reaction: ReactionType[];
|
|
1864
|
+
}
|
|
1865
|
+
export interface MessageReactionCountUpdated {
|
|
1866
|
+
chat: Chat;
|
|
1867
|
+
message_id: Integer;
|
|
1868
|
+
date: Integer;
|
|
1869
|
+
reactions: {
|
|
1870
|
+
type: ReactionType;
|
|
1871
|
+
total_count: Integer;
|
|
1872
|
+
}[];
|
|
1873
|
+
}
|
|
1874
|
+
export type ChatBoostSource = {
|
|
1875
|
+
source: "premium";
|
|
1876
|
+
user: User;
|
|
1877
|
+
} | {
|
|
1878
|
+
source: "gift_code";
|
|
1879
|
+
user: User;
|
|
1880
|
+
} | {
|
|
1881
|
+
source: "giveaway";
|
|
1882
|
+
giveaway_message_id?: Integer;
|
|
1883
|
+
user?: User;
|
|
1884
|
+
prize_star_count?: Integer;
|
|
1885
|
+
is_unclaimed?: boolean;
|
|
1886
|
+
};
|
|
1887
|
+
export interface ChatBoost {
|
|
1888
|
+
boost_id: string;
|
|
1889
|
+
add_date: Integer;
|
|
1890
|
+
expiration_date: Integer;
|
|
1891
|
+
source: ChatBoostSource;
|
|
1892
|
+
}
|
|
1893
|
+
export interface ChatBoostUpdated {
|
|
1894
|
+
chat: Chat;
|
|
1895
|
+
boost: ChatBoost;
|
|
1896
|
+
}
|
|
1897
|
+
export interface ChatBoostRemoved {
|
|
1898
|
+
chat: Chat;
|
|
1899
|
+
boost_id: string;
|
|
1900
|
+
remove_date: Integer;
|
|
1901
|
+
source: ChatBoostSource;
|
|
1902
|
+
}
|
|
1903
|
+
export interface UserChatBoosts {
|
|
1904
|
+
boosts: ChatBoost[];
|
|
1905
|
+
}
|
|
1906
|
+
export interface Giveaway {
|
|
1907
|
+
chats: Chat[];
|
|
1908
|
+
winners_selection_date: Integer;
|
|
1909
|
+
winner_count: Integer;
|
|
1910
|
+
only_new_members?: boolean;
|
|
1911
|
+
has_public_winners?: boolean;
|
|
1912
|
+
prize_description?: string;
|
|
1913
|
+
country_codes?: string[];
|
|
1914
|
+
premium_subscription_month_count?: Integer;
|
|
1915
|
+
/** Bot API 7.10+: number of Telegram Stars to be split among winners, for a Stars giveaway. */
|
|
1916
|
+
prize_star_count?: Integer;
|
|
1917
|
+
}
|
|
1918
|
+
/** Bot API 7.0+: service message about the creation of a scheduled giveaway. */
|
|
1919
|
+
export interface GiveawayCreated {
|
|
1920
|
+
prize_star_count?: Integer;
|
|
1921
|
+
}
|
|
1922
|
+
export interface GiveawayWinners {
|
|
1923
|
+
chat: Chat;
|
|
1924
|
+
giveaway_message_id: Integer;
|
|
1925
|
+
winners_selection_date: Integer;
|
|
1926
|
+
winner_count: Integer;
|
|
1927
|
+
winners: User[];
|
|
1928
|
+
additional_chat_count?: Integer;
|
|
1929
|
+
premium_subscription_month_count?: Integer;
|
|
1930
|
+
unclaimed_prize_count?: Integer;
|
|
1931
|
+
only_new_members?: boolean;
|
|
1932
|
+
was_refunded?: boolean;
|
|
1933
|
+
prize_description?: string;
|
|
1934
|
+
/** Bot API 7.10+ */
|
|
1935
|
+
prize_star_count?: Integer;
|
|
1936
|
+
}
|
|
1937
|
+
export interface GiveawayCompleted {
|
|
1938
|
+
winner_count: Integer;
|
|
1939
|
+
unclaimed_prize_count?: Integer;
|
|
1940
|
+
giveaway_message?: Message;
|
|
1941
|
+
/** Bot API 7.10+: true if the giveaway was a Telegram Star giveaway rather than a Premium giveaway. */
|
|
1942
|
+
is_star_giveaway?: boolean;
|
|
1943
|
+
}
|
|
1944
|
+
/** Bot API only exposes that a story was referenced, not its content. */
|
|
1945
|
+
export interface Story {
|
|
1946
|
+
chat: Chat;
|
|
1947
|
+
id: Integer;
|
|
1948
|
+
}
|
|
1949
|
+
export interface SharedUser {
|
|
1950
|
+
user_id: Integer;
|
|
1951
|
+
first_name?: string;
|
|
1952
|
+
last_name?: string;
|
|
1953
|
+
username?: string;
|
|
1954
|
+
photo?: PhotoSize[];
|
|
1955
|
+
}
|
|
1956
|
+
export interface UsersShared {
|
|
1957
|
+
request_id: Integer;
|
|
1958
|
+
users: SharedUser[];
|
|
1959
|
+
}
|
|
1960
|
+
export interface ChatShared {
|
|
1961
|
+
request_id: Integer;
|
|
1962
|
+
chat_id: Integer;
|
|
1963
|
+
title?: string;
|
|
1964
|
+
username?: string;
|
|
1965
|
+
photo?: PhotoSize[];
|
|
1966
|
+
}
|
|
1967
|
+
export interface WriteAccessAllowed {
|
|
1968
|
+
from_request?: boolean;
|
|
1969
|
+
web_app_name?: string;
|
|
1970
|
+
from_attachment_menu?: boolean;
|
|
1971
|
+
}
|
|
1972
|
+
export interface VideoChatStarted {
|
|
1973
|
+
}
|
|
1974
|
+
export interface VideoChatEnded {
|
|
1975
|
+
duration: Integer;
|
|
1976
|
+
}
|
|
1977
|
+
export interface VideoChatScheduled {
|
|
1978
|
+
start_date: Integer;
|
|
1979
|
+
}
|
|
1980
|
+
export interface VideoChatParticipantsInvited {
|
|
1981
|
+
users: User[];
|
|
1982
|
+
}
|
|
1983
|
+
export interface ForumTopic {
|
|
1984
|
+
message_thread_id: Integer;
|
|
1985
|
+
name: string;
|
|
1986
|
+
icon_color: Integer;
|
|
1987
|
+
icon_custom_emoji_id?: string;
|
|
1988
|
+
/** Bot API 9.3+: true if the topic's name was auto-generated (e.g. from the first message) rather than explicitly set. */
|
|
1989
|
+
is_name_implicit?: boolean;
|
|
1990
|
+
}
|
|
1991
|
+
export interface ForumTopicCreated {
|
|
1992
|
+
name: string;
|
|
1993
|
+
icon_color: Integer;
|
|
1994
|
+
icon_custom_emoji_id?: string;
|
|
1995
|
+
is_name_implicit?: boolean;
|
|
1996
|
+
}
|
|
1997
|
+
export interface ForumTopicEdited {
|
|
1998
|
+
name?: string;
|
|
1999
|
+
icon_custom_emoji_id?: string;
|
|
2000
|
+
}
|
|
2001
|
+
export interface ForumTopicClosed {
|
|
2002
|
+
[key: string]: unknown;
|
|
2003
|
+
}
|
|
2004
|
+
export interface ForumTopicReopened {
|
|
2005
|
+
[key: string]: unknown;
|
|
2006
|
+
}
|
|
2007
|
+
export interface GeneralForumTopicHidden {
|
|
2008
|
+
[key: string]: unknown;
|
|
2009
|
+
}
|
|
2010
|
+
export interface GeneralForumTopicUnhidden {
|
|
2011
|
+
[key: string]: unknown;
|
|
2012
|
+
}
|
|
2013
|
+
export interface LocationAddress {
|
|
2014
|
+
country_code: string;
|
|
2015
|
+
state?: string;
|
|
2016
|
+
city?: string;
|
|
2017
|
+
street?: string;
|
|
2018
|
+
}
|
|
2019
|
+
export interface ChatOwnerLeft {
|
|
2020
|
+
[key: string]: unknown;
|
|
2021
|
+
}
|
|
2022
|
+
export interface ChatOwnerChanged {
|
|
2023
|
+
new_owner?: User;
|
|
2024
|
+
[key: string]: unknown;
|
|
2025
|
+
}
|
|
2026
|
+
/** Bot API 9.0+: service message when the price for sending paid messages in a chat changes. */
|
|
2027
|
+
export interface PaidMessagePriceChanged {
|
|
2028
|
+
paid_message_star_count: Integer;
|
|
2029
|
+
}
|
|
2030
|
+
export type BackgroundFill = {
|
|
2031
|
+
type: "solid";
|
|
2032
|
+
color: Integer;
|
|
2033
|
+
} | {
|
|
2034
|
+
type: "gradient";
|
|
2035
|
+
top_color: Integer;
|
|
2036
|
+
bottom_color: Integer;
|
|
2037
|
+
rotation_angle: Integer;
|
|
2038
|
+
} | {
|
|
2039
|
+
type: "freeform_gradient";
|
|
2040
|
+
colors: Integer[];
|
|
2041
|
+
};
|
|
2042
|
+
export type BackgroundType = {
|
|
2043
|
+
type: "fill";
|
|
2044
|
+
fill: BackgroundFill;
|
|
2045
|
+
dark_theme_dimming: Integer;
|
|
2046
|
+
} | {
|
|
2047
|
+
type: "wallpaper";
|
|
2048
|
+
document: Document;
|
|
2049
|
+
dark_theme_dimming: Integer;
|
|
2050
|
+
is_blurred?: boolean;
|
|
2051
|
+
is_moving?: boolean;
|
|
2052
|
+
} | {
|
|
2053
|
+
type: "pattern";
|
|
2054
|
+
document: Document;
|
|
2055
|
+
fill: BackgroundFill;
|
|
2056
|
+
intensity: Integer;
|
|
2057
|
+
is_inverted?: boolean;
|
|
2058
|
+
is_moving?: boolean;
|
|
2059
|
+
} | {
|
|
2060
|
+
type: "chat_theme";
|
|
2061
|
+
theme_name: string;
|
|
2062
|
+
};
|
|
2063
|
+
export interface ChatBackground {
|
|
2064
|
+
type: BackgroundType;
|
|
2065
|
+
}
|
|
2066
|
+
export type StoryAreaType = {
|
|
2067
|
+
type: "location";
|
|
2068
|
+
latitude: number;
|
|
2069
|
+
longitude: number;
|
|
2070
|
+
address?: LocationAddress;
|
|
2071
|
+
} | {
|
|
2072
|
+
type: "suggested_reaction";
|
|
2073
|
+
reaction_type: ReactionType;
|
|
2074
|
+
is_dark?: boolean;
|
|
2075
|
+
is_flipped?: boolean;
|
|
2076
|
+
} | {
|
|
2077
|
+
type: "link";
|
|
2078
|
+
url: string;
|
|
2079
|
+
} | {
|
|
2080
|
+
type: "weather";
|
|
2081
|
+
temperature: number;
|
|
2082
|
+
emoji: string;
|
|
2083
|
+
background_color: Integer;
|
|
2084
|
+
} | {
|
|
2085
|
+
type: "unique_gift";
|
|
2086
|
+
name: string;
|
|
2087
|
+
};
|
|
2088
|
+
export interface StoryAreaPosition {
|
|
2089
|
+
x_percentage: number;
|
|
2090
|
+
y_percentage: number;
|
|
2091
|
+
width_percentage: number;
|
|
2092
|
+
height_percentage: number;
|
|
2093
|
+
rotation_angle: number;
|
|
2094
|
+
corner_radius_percentage: number;
|
|
2095
|
+
}
|
|
2096
|
+
export interface StoryArea {
|
|
2097
|
+
position: StoryAreaPosition;
|
|
2098
|
+
type: StoryAreaType;
|
|
2099
|
+
}
|
|
2100
|
+
export type InputStoryContent = {
|
|
2101
|
+
type: "photo";
|
|
2102
|
+
photo: InputFile;
|
|
2103
|
+
} | {
|
|
2104
|
+
type: "video";
|
|
2105
|
+
video: InputFile;
|
|
2106
|
+
duration?: number;
|
|
2107
|
+
cover_frame_timestamp?: number;
|
|
2108
|
+
is_animation?: boolean;
|
|
2109
|
+
};
|
|
2110
|
+
export interface LivePhoto {
|
|
2111
|
+
file_id: FileId;
|
|
2112
|
+
file_unique_id: string;
|
|
2113
|
+
width: Integer;
|
|
2114
|
+
height: Integer;
|
|
2115
|
+
thumbnail?: PhotoSize;
|
|
2116
|
+
file_size?: Integer;
|
|
2117
|
+
}
|
|
2118
|
+
export interface MessageAutoDeleteTimerChanged {
|
|
2119
|
+
message_auto_delete_time: Integer;
|
|
2120
|
+
}
|
|
2121
|
+
export interface MessageId {
|
|
2122
|
+
message_id: Integer;
|
|
2123
|
+
}
|
|
2124
|
+
export interface UserProfilePhotos {
|
|
2125
|
+
total_count: Integer;
|
|
2126
|
+
photos: PhotoSize[][];
|
|
2127
|
+
}
|
|
2128
|
+
export interface UserProfileAudios {
|
|
2129
|
+
total_count: Integer;
|
|
2130
|
+
audios: Audio[][];
|
|
2131
|
+
}
|
|
2132
|
+
export interface InputPollOption {
|
|
2133
|
+
text: string;
|
|
2134
|
+
text_parse_mode?: ParseMode;
|
|
2135
|
+
text_entities?: MessageEntity[];
|
|
2136
|
+
}
|
|
2137
|
+
/** A paid media purchase event surfaced to the bot for a channel post it made. */
|
|
2138
|
+
export interface PaidMediaPurchased {
|
|
2139
|
+
from: User;
|
|
2140
|
+
paid_media_payload: string;
|
|
2141
|
+
}
|
|
2142
|
+
export interface Gift {
|
|
2143
|
+
id: string;
|
|
2144
|
+
sticker: Sticker;
|
|
2145
|
+
star_count: Integer;
|
|
2146
|
+
upgrade_star_count?: Integer;
|
|
2147
|
+
total_count?: Integer;
|
|
2148
|
+
remaining_count?: Integer;
|
|
2149
|
+
personal_total_count?: Integer;
|
|
2150
|
+
personal_remaining_count?: Integer;
|
|
2151
|
+
is_premium?: boolean;
|
|
2152
|
+
publisher_chat?: Chat;
|
|
2153
|
+
/** Bot API 9.6+: true if this gift, once upgraded, can carry a custom name-color scheme (see UniqueGiftColors). */
|
|
2154
|
+
has_colors?: boolean;
|
|
2155
|
+
/** Bot API 9.3+ */
|
|
2156
|
+
background?: GiftBackground;
|
|
2157
|
+
/** Bot API 9.3+: number of distinct model/symbol/backdrop variants available when this gift is upgraded. */
|
|
2158
|
+
unique_gift_variant_count?: Integer;
|
|
2159
|
+
}
|
|
2160
|
+
/**
|
|
2161
|
+
* Bot API 9.3+: background styling for a gift's presentation. Confirmed to
|
|
2162
|
+
* exist (official changelog: "Added the class GiftBackground and the field
|
|
2163
|
+
* background to the class Gift"), but I could not independently confirm its
|
|
2164
|
+
* field names after genuine effort — this shape is inferred from the
|
|
2165
|
+
* confirmed BackgroundType/BackgroundFill pattern used elsewhere in this
|
|
2166
|
+
* file, not verified against a second source. Treat as best-effort.
|
|
2167
|
+
*/
|
|
2168
|
+
export interface GiftBackground {
|
|
2169
|
+
fill?: BackgroundFill;
|
|
2170
|
+
[extra: string]: unknown;
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* Bot API 9.3+: color scheme (name, message replies, link previews) derived
|
|
2174
|
+
* from a unique gift. Confirmed to exist (official changelog + two SDK
|
|
2175
|
+
* changelogs), but despite genuine effort across multiple searches I could
|
|
2176
|
+
* not find its exact field names in any source. This shape is inferred from
|
|
2177
|
+
* the confirmed sibling type UniqueGiftBackdropColors (same feature area,
|
|
2178
|
+
* same "named colors for UI theming" purpose) — NOT independently verified.
|
|
2179
|
+
* Verify against core.telegram.org/bots/api before relying on specific
|
|
2180
|
+
* field names here.
|
|
2181
|
+
*/
|
|
2182
|
+
export interface UniqueGiftColors {
|
|
2183
|
+
text_color?: Integer;
|
|
2184
|
+
background_color?: Integer;
|
|
2185
|
+
accent_color?: Integer;
|
|
2186
|
+
[extra: string]: unknown;
|
|
2187
|
+
}
|
|
2188
|
+
/**
|
|
2189
|
+
* Bot API 9.3+: a user's rating level within Telegram. Confirmed to exist
|
|
2190
|
+
* (official changelog: "Added the class UserRating and the field rating to
|
|
2191
|
+
* the class ChatFullInfo"), but exact field names weren't independently
|
|
2192
|
+
* confirmed — modeled on the general shape Telegram uses for tiered rating
|
|
2193
|
+
* systems elsewhere. Verify against current docs before relying on this.
|
|
2194
|
+
*/
|
|
2195
|
+
export interface UserRating {
|
|
2196
|
+
level: Integer;
|
|
2197
|
+
[extra: string]: unknown;
|
|
2198
|
+
}
|
|
2199
|
+
/** Bot API 9.3+: service message about a price change for Direct Messages sent to a channel chat. */
|
|
2200
|
+
export interface DirectMessagePriceChanged {
|
|
2201
|
+
are_direct_messages_enabled: boolean;
|
|
2202
|
+
direct_message_star_count?: Integer;
|
|
2203
|
+
}
|
|
2204
|
+
export interface UniqueGiftModel {
|
|
2205
|
+
name: string;
|
|
2206
|
+
sticker: Sticker;
|
|
2207
|
+
/** Number of unique gifts that receive this model per 1000 gifts upgraded. */
|
|
2208
|
+
rarity_per_mille: Integer;
|
|
2209
|
+
/** Bot API 9.6+ */
|
|
2210
|
+
rarity?: Integer;
|
|
2211
|
+
}
|
|
2212
|
+
export interface UniqueGiftSymbol {
|
|
2213
|
+
name: string;
|
|
2214
|
+
sticker: Sticker;
|
|
2215
|
+
rarity_per_mille: Integer;
|
|
2216
|
+
}
|
|
2217
|
+
export interface UniqueGiftBackdropColors {
|
|
2218
|
+
center_color: Integer;
|
|
2219
|
+
edge_color: Integer;
|
|
2220
|
+
symbol_color: Integer;
|
|
2221
|
+
text_color: Integer;
|
|
2222
|
+
}
|
|
2223
|
+
export interface UniqueGiftBackdrop {
|
|
2224
|
+
name: string;
|
|
2225
|
+
colors: UniqueGiftBackdropColors;
|
|
2226
|
+
rarity_per_mille: Integer;
|
|
2227
|
+
}
|
|
2228
|
+
export interface Gifts {
|
|
2229
|
+
gifts: Gift[];
|
|
2230
|
+
}
|
|
2231
|
+
/** A gift that was upgraded to a one-of-a-kind collectible. */
|
|
2232
|
+
export interface UniqueGift {
|
|
2233
|
+
base_name: string;
|
|
2234
|
+
name: string;
|
|
2235
|
+
number: Integer;
|
|
2236
|
+
model: UniqueGiftModel;
|
|
2237
|
+
symbol: UniqueGiftSymbol;
|
|
2238
|
+
backdrop: UniqueGiftBackdrop;
|
|
2239
|
+
is_premium?: boolean;
|
|
2240
|
+
is_from_blockchain?: boolean;
|
|
2241
|
+
publisher_chat?: Chat;
|
|
2242
|
+
/** Bot API 9.6+: true if this gift was destroyed ("burned"). */
|
|
2243
|
+
is_burned?: boolean;
|
|
2244
|
+
/** Bot API 9.3+ */
|
|
2245
|
+
colors?: UniqueGiftColors;
|
|
2246
|
+
/** Bot API 9.3+: the identifier of the regular Gift this was upgraded from. */
|
|
2247
|
+
gift_id?: string;
|
|
2248
|
+
}
|
|
2249
|
+
export interface GiftInfo {
|
|
2250
|
+
gift: Gift;
|
|
2251
|
+
owned_gift_id?: string;
|
|
2252
|
+
convert_star_count?: Integer;
|
|
2253
|
+
prepaid_upgrade_star_count?: Integer;
|
|
2254
|
+
can_be_upgraded?: boolean;
|
|
2255
|
+
text?: string;
|
|
2256
|
+
entities?: MessageEntity[];
|
|
2257
|
+
is_private?: boolean;
|
|
2258
|
+
is_upgrade_separate?: boolean;
|
|
2259
|
+
/** Bot API 9.3+: which variant number this gift would become if upgraded. */
|
|
2260
|
+
unique_gift_number?: Integer;
|
|
2261
|
+
}
|
|
2262
|
+
export interface UniqueGiftInfo {
|
|
2263
|
+
gift: UniqueGift;
|
|
2264
|
+
origin: "upgrade" | "transfer" | "resale" | "gifted_upgrade" | "offer";
|
|
2265
|
+
owned_gift_id?: string;
|
|
2266
|
+
transfer_star_count?: Integer;
|
|
2267
|
+
next_transfer_date?: Integer;
|
|
2268
|
+
/** @deprecated replaced by last_resale_currency + last_resale_amount — kept for reading old cached data. */
|
|
2269
|
+
last_resale_star_count?: Integer;
|
|
2270
|
+
/** Bot API 9.3+ */
|
|
2271
|
+
last_resale_currency?: string;
|
|
2272
|
+
last_resale_amount?: Integer;
|
|
2273
|
+
/** Bot API 10.3+ */
|
|
2274
|
+
text?: string;
|
|
2275
|
+
/** Bot API 10.3+ */
|
|
2276
|
+
entities?: MessageEntity[];
|
|
2277
|
+
/** Bot API 10.3+ */
|
|
2278
|
+
is_private?: boolean;
|
|
2279
|
+
}
|
|
2280
|
+
export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique;
|
|
2281
|
+
export interface OwnedGiftRegular {
|
|
2282
|
+
type: "regular";
|
|
2283
|
+
gift: Gift;
|
|
2284
|
+
owned_gift_id?: string;
|
|
2285
|
+
sender_user?: User;
|
|
2286
|
+
send_date: Integer;
|
|
2287
|
+
text?: string;
|
|
2288
|
+
entities?: MessageEntity[];
|
|
2289
|
+
is_private?: boolean;
|
|
2290
|
+
is_saved?: boolean;
|
|
2291
|
+
can_be_upgraded?: boolean;
|
|
2292
|
+
was_refunded?: boolean;
|
|
2293
|
+
convert_star_count?: Integer;
|
|
2294
|
+
prepaid_upgrade_star_count?: Integer;
|
|
2295
|
+
is_upgrade_separate?: boolean;
|
|
2296
|
+
/** Bot API 9.3+ */
|
|
2297
|
+
unique_gift_number?: Integer;
|
|
2298
|
+
}
|
|
2299
|
+
export interface OwnedGiftUnique {
|
|
2300
|
+
type: "unique";
|
|
2301
|
+
gift: UniqueGift;
|
|
2302
|
+
owned_gift_id?: string;
|
|
2303
|
+
sender_user?: User;
|
|
2304
|
+
send_date: Integer;
|
|
2305
|
+
is_saved?: boolean;
|
|
2306
|
+
can_be_transferred?: boolean;
|
|
2307
|
+
transfer_star_count?: Integer;
|
|
2308
|
+
next_transfer_date?: Integer;
|
|
2309
|
+
}
|
|
2310
|
+
export interface AcceptedGiftTypes {
|
|
2311
|
+
unlimited_gifts: boolean;
|
|
2312
|
+
limited_gifts: boolean;
|
|
2313
|
+
unique_gifts: boolean;
|
|
2314
|
+
premium_subscription: boolean;
|
|
2315
|
+
/** Bot API 9.3+ */
|
|
2316
|
+
gifts_from_channels: boolean;
|
|
2317
|
+
}
|
|
2318
|
+
export interface StarAmount {
|
|
2319
|
+
amount: Integer;
|
|
2320
|
+
nanostar_amount?: Integer;
|
|
2321
|
+
}
|
|
2322
|
+
export interface AffiliateInfo {
|
|
2323
|
+
affiliate_user?: User;
|
|
2324
|
+
affiliate_chat?: Chat;
|
|
2325
|
+
commission_per_mille: Integer;
|
|
2326
|
+
amount: Integer;
|
|
2327
|
+
nanostar_amount?: Integer;
|
|
2328
|
+
}
|
|
2329
|
+
/** Which counterparty was on the other end of a Stars transaction. */
|
|
2330
|
+
export type TransactionPartner = {
|
|
2331
|
+
type: "user";
|
|
2332
|
+
transaction_type: "invoice_payment" | "paid_media_payment" | "gift_purchase" | "premium_purchase" | "business_account_transfer" | string;
|
|
2333
|
+
user: User;
|
|
2334
|
+
affiliate?: AffiliateInfo;
|
|
2335
|
+
invoice_payload?: string;
|
|
2336
|
+
subscription_period?: Integer;
|
|
2337
|
+
paid_media?: PaidMedia[];
|
|
2338
|
+
paid_media_payload?: string;
|
|
2339
|
+
gift?: Gift;
|
|
2340
|
+
premium_subscription_duration?: Integer;
|
|
2341
|
+
} | {
|
|
2342
|
+
type: "chat";
|
|
2343
|
+
chat: Chat;
|
|
2344
|
+
gift?: Gift;
|
|
2345
|
+
} | {
|
|
2346
|
+
type: "affiliate_program";
|
|
2347
|
+
sponsor_user?: User;
|
|
2348
|
+
commission_per_mille: Integer;
|
|
2349
|
+
} | {
|
|
2350
|
+
type: "fragment";
|
|
2351
|
+
withdrawal_state?: Record<string, unknown>;
|
|
2352
|
+
} | {
|
|
2353
|
+
type: "telegram_ads";
|
|
2354
|
+
} | {
|
|
2355
|
+
type: "telegram_api";
|
|
2356
|
+
request_count: Integer;
|
|
2357
|
+
} | {
|
|
2358
|
+
type: "other";
|
|
2359
|
+
};
|
|
2360
|
+
export interface StarTransaction {
|
|
2361
|
+
id: string;
|
|
2362
|
+
amount: Integer;
|
|
2363
|
+
nanostar_amount?: Integer;
|
|
2364
|
+
date: Integer;
|
|
2365
|
+
source?: TransactionPartner;
|
|
2366
|
+
receiver?: TransactionPartner;
|
|
2367
|
+
}
|
|
2368
|
+
export interface StarTransactions {
|
|
2369
|
+
transactions: StarTransaction[];
|
|
2370
|
+
}
|
|
2371
|
+
export interface RefundedPayment {
|
|
2372
|
+
currency: string;
|
|
2373
|
+
total_amount: Integer;
|
|
2374
|
+
invoice_payload: string;
|
|
2375
|
+
telegram_payment_charge_id: string;
|
|
2376
|
+
provider_payment_charge_id?: string;
|
|
2377
|
+
}
|
|
2378
|
+
export interface SuggestedPostPrice {
|
|
2379
|
+
currency: "XTR" | "TON";
|
|
2380
|
+
amount: Integer;
|
|
2381
|
+
}
|
|
2382
|
+
export interface SuggestedPostParameters {
|
|
2383
|
+
price?: SuggestedPostPrice;
|
|
2384
|
+
send_date?: Integer;
|
|
2385
|
+
}
|
|
2386
|
+
export interface SuggestedPostInfo {
|
|
2387
|
+
state: "pending" | "approved" | "declined";
|
|
2388
|
+
price?: SuggestedPostPrice;
|
|
2389
|
+
send_date?: Integer;
|
|
2390
|
+
}
|
|
2391
|
+
export interface SuggestedPostApproved {
|
|
2392
|
+
suggested_post_message?: Message;
|
|
2393
|
+
price?: SuggestedPostPrice;
|
|
2394
|
+
send_date: Integer;
|
|
2395
|
+
}
|
|
2396
|
+
export interface SuggestedPostApprovalFailed {
|
|
2397
|
+
suggested_post_message?: Message;
|
|
2398
|
+
price?: SuggestedPostPrice;
|
|
2399
|
+
}
|
|
2400
|
+
export interface SuggestedPostDeclined {
|
|
2401
|
+
suggested_post_message?: Message;
|
|
2402
|
+
comment?: string;
|
|
2403
|
+
}
|
|
2404
|
+
export interface SuggestedPostPaid {
|
|
2405
|
+
suggested_post_message?: Message;
|
|
2406
|
+
currency: string;
|
|
2407
|
+
amount?: Integer;
|
|
2408
|
+
star_amount?: StarAmount;
|
|
2409
|
+
}
|
|
2410
|
+
export interface SuggestedPostRefunded {
|
|
2411
|
+
suggested_post_message?: Message;
|
|
2412
|
+
reason: "post_deleted" | "payment_refunded";
|
|
2413
|
+
}
|
|
2414
|
+
export interface DirectMessagesTopic {
|
|
2415
|
+
topic_id: Integer;
|
|
2416
|
+
user?: User;
|
|
2417
|
+
}
|
|
2418
|
+
export interface SentGuestMessage {
|
|
2419
|
+
message: Message;
|
|
2420
|
+
}
|
|
2421
|
+
export interface ChecklistTask {
|
|
2422
|
+
id: Integer;
|
|
2423
|
+
text: string;
|
|
2424
|
+
text_entities?: MessageEntity[];
|
|
2425
|
+
completed_by_user?: User;
|
|
2426
|
+
/** Bot API 9.6+: the chat that completed this task, when completed on behalf of a chat rather than a user. */
|
|
2427
|
+
completed_by_chat?: Chat;
|
|
2428
|
+
completion_date?: Integer;
|
|
2429
|
+
}
|
|
2430
|
+
export interface Checklist {
|
|
2431
|
+
title: string;
|
|
2432
|
+
title_entities?: MessageEntity[];
|
|
2433
|
+
tasks: ChecklistTask[];
|
|
2434
|
+
others_can_add_tasks?: boolean;
|
|
2435
|
+
others_can_mark_tasks_as_done?: boolean;
|
|
2436
|
+
}
|
|
2437
|
+
export interface InputChecklistTask {
|
|
2438
|
+
id: Integer;
|
|
2439
|
+
text: string;
|
|
2440
|
+
parse_mode?: ParseMode;
|
|
2441
|
+
text_entities?: MessageEntity[];
|
|
2442
|
+
}
|
|
2443
|
+
/** Describes a checklist to create — 1 to 30 tasks. */
|
|
2444
|
+
export interface InputChecklist {
|
|
2445
|
+
title: string;
|
|
2446
|
+
parse_mode?: ParseMode;
|
|
2447
|
+
title_entities?: MessageEntity[];
|
|
2448
|
+
tasks: InputChecklistTask[];
|
|
2449
|
+
others_can_add_tasks?: boolean;
|
|
2450
|
+
others_can_mark_tasks_as_done?: boolean;
|
|
2451
|
+
}
|
|
2452
|
+
/** Service message: one or more tasks were marked done/not-done. */
|
|
2453
|
+
export interface ChecklistTasksDone {
|
|
2454
|
+
checklist_message?: Message;
|
|
2455
|
+
marked_as_done_task_ids?: Integer[];
|
|
2456
|
+
marked_as_not_done_task_ids?: Integer[];
|
|
2457
|
+
}
|
|
2458
|
+
/** Service message: new tasks were added to an existing checklist. */
|
|
2459
|
+
export interface ChecklistTasksAdded {
|
|
2460
|
+
checklist_message?: Message;
|
|
2461
|
+
tasks: ChecklistTask[];
|
|
2462
|
+
}
|
|
2463
|
+
export interface BotCommand {
|
|
2464
|
+
command: string;
|
|
2465
|
+
description: string;
|
|
2466
|
+
/** Bot API 10.2+: if true, this command's replies are only visible to the user who sent it (Ephemeral Messages). */
|
|
2467
|
+
is_ephemeral?: boolean;
|
|
2468
|
+
}
|
|
2469
|
+
export interface WebhookInfo {
|
|
2470
|
+
url: string;
|
|
2471
|
+
has_custom_certificate: boolean;
|
|
2472
|
+
pending_update_count: Integer;
|
|
2473
|
+
last_error_date?: Integer;
|
|
2474
|
+
last_error_message?: string;
|
|
2475
|
+
max_connections?: Integer;
|
|
2476
|
+
allowed_updates?: string[];
|
|
2477
|
+
}
|
|
2478
|
+
export interface StickerSet {
|
|
2479
|
+
name: string;
|
|
2480
|
+
title: string;
|
|
2481
|
+
sticker_type: "regular" | "mask" | "custom_emoji";
|
|
2482
|
+
stickers: Sticker[];
|
|
2483
|
+
thumbnail?: PhotoSize;
|
|
2484
|
+
}
|
|
2485
|
+
export {};
|