@grammyjs/types 3.22.2 → 3.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/checklist.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { User } from "./manage.js";
1
+ import type { Chat, User } from "./manage.js";
2
2
  import type { Message, MessageEntity, ParseMode } from "./message.js";
3
3
  /** Describes a task in a checklist. */
4
4
  export interface ChecklistTask {
@@ -8,8 +8,10 @@ export interface ChecklistTask {
8
8
  text: string;
9
9
  /** Special entities that appear in the task text */
10
10
  text_entities?: MessageEntity[];
11
- /** User that completed the task; omitted if the task wasn't completed */
11
+ /** User that completed the task; omitted if the task wasn't completed by a user */
12
12
  completed_by_user?: User;
13
+ /** Chat that completed the task; omitted if the task wasn't completed by a chat */
14
+ completed_by_chat?: Chat;
13
15
  /** Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed */
14
16
  completion_date?: number;
15
17
  }
@@ -33,7 +35,7 @@ export interface InputChecklistTask {
33
35
  /** Text of the task; 1-100 characters after entities parsing */
34
36
  text: string;
35
37
  /** Mode for parsing entities in the text. See formatting options for more details. */
36
- parse_mode?: string;
38
+ parse_mode?: ParseMode;
37
39
  /** List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed. */
38
40
  text_entities?: MessageEntity[];
39
41
  }
package/inline.d.ts CHANGED
@@ -621,7 +621,7 @@ export interface InputInvoiceMessageContent {
621
621
  description: string;
622
622
  /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
623
623
  payload: string;
624
- /** Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */
624
+ /** Payment provider token, obtained via `@BotFather`. Pass an empty string for payments in Telegram Stars. */
625
625
  provider_token?: string;
626
626
  /** Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */
627
627
  currency: string;
@@ -658,7 +658,7 @@ export interface InputInvoiceMessageContent {
658
658
  }
659
659
  /** Represents a result of an inline query that was chosen by the user and sent to their chat partner.
660
660
 
661
- Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates. */
661
+ Note: It is necessary to enable inline feedback via `@BotFather` in order to receive these objects in updates. */
662
662
  export interface ChosenInlineResult {
663
663
  /** The unique identifier for the result that was chosen */
664
664
  result_id: string;
package/manage.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { Location, Message, PhotoSize, ReactionType, Sticker } from "./message.js";
1
+ import type { Audio, Location, Message, PhotoSize, ReactionType, Sticker } from "./message.js";
2
+ import type { UniqueGiftColors } from "./payment.js";
2
3
  import type { Update } from "./update.js";
3
4
  /** Describes the current status of a webhook. */
4
5
  export interface WebhookInfo {
@@ -31,6 +32,8 @@ export interface AcceptedGiftTypes {
31
32
  unique_gifts: boolean;
32
33
  /** True, if a Telegram Premium subscription is accepted */
33
34
  premium_subscription: boolean;
35
+ /** True, if transfers of unique gifts from channels are accepted */
36
+ gifts_from_channels: boolean;
34
37
  }
35
38
  /** This object represents a Telegram user or bot. */
36
39
  export interface User {
@@ -65,6 +68,31 @@ export interface UserFromGetMe extends User {
65
68
  can_connect_to_business: boolean;
66
69
  /** True, if the bot has main Web App. Returned only in getMe. */
67
70
  has_main_web_app: boolean;
71
+ /** True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. */
72
+ has_topics_enabled: boolean;
73
+ /** True, if the bot allows users to create and delete topics in private chats. Returned only in getMe. */
74
+ allows_users_to_create_topics: boolean;
75
+ }
76
+ /** Describes a service message about the chat owner leaving the chat. */
77
+ export interface ChatOwnerLeft {
78
+ /** The user which will be the new owner of the chat if the previous owner does not return to the chat */
79
+ new_owner?: User;
80
+ }
81
+ /** Describes a service message about an ownership change in the chat. */
82
+ export interface ChatOwnerChanged {
83
+ /** The new owner of the chat */
84
+ new_owner: User;
85
+ }
86
+ /** This object describes the rating of a user based on their Telegram Star spendings. */
87
+ export interface UserRating {
88
+ /** Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern. */
89
+ level: number;
90
+ /** Numerical value of the user's rating; the higher the rating, the better */
91
+ rating: number;
92
+ /** The rating value required to get the current level */
93
+ current_level_rating: number;
94
+ /** The rating value required to get to the next level; omitted if the maximum level was reached */
95
+ next_level_rating?: number;
68
96
  }
69
97
  export declare namespace Chat {
70
98
  /** Internal type for private chats */
@@ -163,12 +191,16 @@ export declare namespace ChatFullInfo {
163
191
  last_name?: string;
164
192
  /** True, if the supergroup chat is a forum (has topics enabled) */
165
193
  is_forum?: undefined;
194
+ /** True, if the chat is the direct messages chat of a channel */
195
+ is_direct_messages?: undefined;
166
196
  /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */
167
197
  accent_color_id: number;
168
198
  /** The maximum number of reactions that can be set on a message in the chat */
169
199
  max_reaction_count: number;
170
200
  /** Chat photo */
171
201
  photo?: ChatPhoto;
202
+ /** For private chats, the first audio added to the profile of the user */
203
+ first_profile_audio?: Audio;
172
204
  /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
173
205
  active_usernames?: string[];
174
206
  /** For private chats, the date of birth of the user */
@@ -179,8 +211,14 @@ export declare namespace ChatFullInfo {
179
211
  business_location?: BusinessLocation;
180
212
  /** For private chats with business accounts, the opening hours of the business */
181
213
  business_opening_hours?: BusinessOpeningHours;
214
+ /** For private chats, the rating of the user if any */
215
+ rating?: UserRating;
216
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
217
+ unique_gift_colors?: UniqueGiftColors;
182
218
  /** For private chats, the personal channel of the user */
183
219
  personal_chat?: Chat;
220
+ /** Information about the corresponding channel chat; for direct messages chats only */
221
+ parent_chat?: undefined;
184
222
  /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
185
223
  available_reactions?: ReactionType[];
186
224
  /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -237,8 +275,6 @@ export declare namespace ChatFullInfo {
237
275
  custom_emoji_sticker_set_name?: undefined;
238
276
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
239
277
  linked_chat_id?: undefined;
240
- /** Information about the corresponding channel chat; for direct messages chats only */
241
- parent_chat?: undefined;
242
278
  /** For supergroups, the location to which the supergroup is connected */
243
279
  location?: undefined;
244
280
  }
@@ -258,12 +294,16 @@ export declare namespace ChatFullInfo {
258
294
  last_name?: undefined;
259
295
  /** True, if the supergroup chat is a forum (has topics enabled) */
260
296
  is_forum?: undefined;
297
+ /** True, if the chat is the direct messages chat of a channel */
298
+ is_direct_messages?: undefined;
261
299
  /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */
262
300
  accent_color_id: number;
263
301
  /** The maximum number of reactions that can be set on a message in the chat */
264
302
  max_reaction_count: number;
265
303
  /** Chat photo */
266
304
  photo?: ChatPhoto;
305
+ /** For private chats, the first audio added to the profile of the user */
306
+ first_profile_audio?: undefined;
267
307
  /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
268
308
  active_usernames?: undefined;
269
309
  /** For private chats, the date of birth of the user */
@@ -274,8 +314,14 @@ export declare namespace ChatFullInfo {
274
314
  business_location?: undefined;
275
315
  /** For private chats with business accounts, the opening hours of the business */
276
316
  business_opening_hours?: undefined;
317
+ /** For private chats, the rating of the user if any */
318
+ rating?: undefined;
319
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
320
+ unique_gift_colors?: UniqueGiftColors;
277
321
  /** For private chats, the personal channel of the user */
278
322
  personal_chat?: undefined;
323
+ /** Information about the corresponding channel chat; for direct messages chats only */
324
+ parent_chat?: undefined;
279
325
  /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
280
326
  available_reactions?: ReactionType[];
281
327
  /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -332,8 +378,6 @@ export declare namespace ChatFullInfo {
332
378
  custom_emoji_sticker_set_name?: undefined;
333
379
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
334
380
  linked_chat_id?: undefined;
335
- /** Information about the corresponding channel chat; for direct messages chats only */
336
- parent_chat?: undefined;
337
381
  /** For supergroups, the location to which the supergroup is connected */
338
382
  location?: undefined;
339
383
  }
@@ -353,12 +397,16 @@ export declare namespace ChatFullInfo {
353
397
  last_name?: undefined;
354
398
  /** True, if the supergroup chat is a forum (has topics enabled) */
355
399
  is_forum?: true;
400
+ /** True, if the chat is the direct messages chat of a channel */
401
+ is_direct_messages?: true;
356
402
  /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */
357
403
  accent_color_id: number;
358
404
  /** The maximum number of reactions that can be set on a message in the chat */
359
405
  max_reaction_count: number;
360
406
  /** Chat photo */
361
407
  photo?: ChatPhoto;
408
+ /** For private chats, the first audio added to the profile of the user */
409
+ first_profile_audio?: undefined;
362
410
  /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
363
411
  active_usernames?: string[];
364
412
  /** For private chats, the date of birth of the user */
@@ -369,8 +417,14 @@ export declare namespace ChatFullInfo {
369
417
  business_location?: undefined;
370
418
  /** For private chats with business accounts, the opening hours of the business */
371
419
  business_opening_hours?: undefined;
420
+ /** For private chats, the rating of the user if any */
421
+ rating?: undefined;
422
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
423
+ unique_gift_colors?: UniqueGiftColors;
372
424
  /** For private chats, the personal channel of the user */
373
425
  personal_chat?: undefined;
426
+ /** Information about the corresponding channel chat; for direct messages chats only */
427
+ parent_chat?: Chat.ChannelChat;
374
428
  /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
375
429
  available_reactions?: ReactionType[];
376
430
  /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -427,8 +481,6 @@ export declare namespace ChatFullInfo {
427
481
  custom_emoji_sticker_set_name?: string;
428
482
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
429
483
  linked_chat_id?: number;
430
- /** Information about the corresponding channel chat; for direct messages chats only */
431
- parent_chat?: Chat.ChannelChat;
432
484
  /** For supergroups, the location to which the supergroup is connected */
433
485
  location?: ChatLocation;
434
486
  }
@@ -448,12 +500,16 @@ export declare namespace ChatFullInfo {
448
500
  last_name?: undefined;
449
501
  /** True, if the supergroup chat is a forum (has topics enabled) */
450
502
  is_forum?: undefined;
503
+ /** True, if the chat is the direct messages chat of a channel */
504
+ is_direct_messages?: undefined;
451
505
  /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */
452
506
  accent_color_id: number;
453
507
  /** The maximum number of reactions that can be set on a message in the chat */
454
508
  max_reaction_count: number;
455
509
  /** Chat photo */
456
510
  photo?: ChatPhoto;
511
+ /** For private chats, the first audio added to the profile of the user */
512
+ first_profile_audio?: undefined;
457
513
  /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
458
514
  active_usernames?: string[];
459
515
  /** For private chats, the date of birth of the user */
@@ -464,8 +520,14 @@ export declare namespace ChatFullInfo {
464
520
  business_location?: undefined;
465
521
  /** For private chats with business accounts, the opening hours of the business */
466
522
  business_opening_hours?: undefined;
523
+ /** For private chats, the rating of the user if any */
524
+ rating?: undefined;
525
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
526
+ unique_gift_colors?: UniqueGiftColors;
467
527
  /** For private chats, the personal channel of the user */
468
528
  personal_chat?: undefined;
529
+ /** Information about the corresponding channel chat; for direct messages chats only */
530
+ parent_chat?: undefined;
469
531
  /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
470
532
  available_reactions?: ReactionType[];
471
533
  /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -522,8 +584,6 @@ export declare namespace ChatFullInfo {
522
584
  custom_emoji_sticker_set_name?: undefined;
523
585
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
524
586
  linked_chat_id?: number;
525
- /** Information about the corresponding channel chat; for direct messages chats only */
526
- parent_chat?: undefined;
527
587
  /** For supergroups, the location to which the supergroup is connected */
528
588
  location?: undefined;
529
589
  }
@@ -539,6 +599,13 @@ export interface UserProfilePhotos {
539
599
  /** Requested profile pictures (in up to 4 sizes each) */
540
600
  photos: PhotoSize[][];
541
601
  }
602
+ /** This object represents the audios displayed on a user's profile. */
603
+ export interface UserProfileAudios {
604
+ /** Total number of profile audios for the target user */
605
+ total_count: number;
606
+ /** Requested profile audios */
607
+ audios: Audio[];
608
+ }
542
609
  /** This object represents a chat photo. */
543
610
  export interface ChatPhoto {
544
611
  /** File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
@@ -853,6 +920,8 @@ export interface ForumTopic {
853
920
  message_thread_id: number;
854
921
  /** Name of the topic */
855
922
  name: string;
923
+ /** True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
924
+ is_name_implicit?: true;
856
925
  /** Color of the topic icon in RGB format */
857
926
  icon_color: number;
858
927
  /** Unique identifier of the custom emoji shown as the topic icon */
package/markup.d.ts CHANGED
@@ -9,6 +9,10 @@ export declare namespace InlineKeyboardButton {
9
9
  interface AbstractInlineKeyboardButton {
10
10
  /** Label text on the button */
11
11
  text: string;
12
+ /** Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. */
13
+ icon_custom_emoji_id?: string;
14
+ /** Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. */
15
+ style?: "danger" | "success" | "primary";
12
16
  }
13
17
  interface UrlButton extends AbstractInlineKeyboardButton {
14
18
  /** HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings. */
@@ -57,7 +61,7 @@ export declare namespace InlineKeyboardButton {
57
61
  pay: boolean;
58
62
  }
59
63
  }
60
- /** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. */
64
+ /** This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. */
61
65
  export type InlineKeyboardButton = InlineKeyboardButton.CallbackButton | InlineKeyboardButton.GameButton | InlineKeyboardButton.LoginButton | InlineKeyboardButton.PayButton | InlineKeyboardButton.SwitchInlineButton | InlineKeyboardButton.SwitchInlineCurrentChatButton | InlineKeyboardButton.SwitchInlineChosenChatButton | InlineKeyboardButton.CopyTextButtonButton | InlineKeyboardButton.UrlButton | InlineKeyboardButton.WebAppButton;
62
66
  /** This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
63
67
  Telegram apps support these buttons as of version 5.7. */
@@ -120,15 +124,19 @@ export interface ReplyKeyboardMarkup {
120
124
  one_time_keyboard?: boolean;
121
125
  /** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
122
126
  input_field_placeholder?: string;
123
- /** Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
127
+ /** Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are `@mentioned` in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
124
128
 
125
129
  Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. */
126
130
  selective?: boolean;
127
131
  }
128
132
  export declare namespace KeyboardButton {
129
133
  interface CommonButton {
130
- /** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
134
+ /** Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed */
131
135
  text: string;
136
+ /** Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. */
137
+ icon_custom_emoji_id?: string;
138
+ /** Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. */
139
+ style?: "danger" | "success" | "primary";
132
140
  }
133
141
  interface RequestUsersButton extends CommonButton {
134
142
  /** If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. */
@@ -155,7 +163,7 @@ export declare namespace KeyboardButton {
155
163
  web_app: WebAppInfo;
156
164
  }
157
165
  }
158
- /** This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text. */
166
+ /** This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text. */
159
167
  export type KeyboardButton = KeyboardButton.CommonButton | KeyboardButton.RequestUsersButton | KeyboardButton.RequestChatButton | KeyboardButton.RequestContactButton | KeyboardButton.RequestLocationButton | KeyboardButton.RequestPollButton | KeyboardButton.WebAppButton | string;
160
168
  /** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
161
169
  export interface KeyboardButtonPollType {
@@ -166,7 +174,7 @@ export interface KeyboardButtonPollType {
166
174
  export interface ReplyKeyboardRemove {
167
175
  /** Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) */
168
176
  remove_keyboard: true;
169
- /** Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
177
+ /** Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are `@mentioned` in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
170
178
 
171
179
  Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. */
172
180
  selective?: boolean;
@@ -185,7 +193,7 @@ export interface ForceReply {
185
193
  force_reply: true;
186
194
  /** The placeholder to be shown in the input field when the reply is active; 1-64 characters */
187
195
  input_field_placeholder?: string;
188
- /** Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. */
196
+ /** Use this parameter if you want to force reply from specific users only. Targets: 1) users that are `@mentioned` in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. */
189
197
  selective?: boolean;
190
198
  }
191
199
  /** This object represents an inline keyboard button that copies specified text to the clipboard. */
package/message.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Checklist, ChecklistTasksAdded, ChecklistTasksDone } from "./checklist.js";
2
- import type { Chat, User } from "./manage.js";
2
+ import type { Chat, ChatOwnerChanged, ChatOwnerLeft, User } from "./manage.js";
3
3
  import type { InlineKeyboardMarkup } from "./markup.js";
4
4
  import type { PassportData } from "./passport.js";
5
5
  import type { GiftInfo, Invoice, PaidMessagePriceChanged, RefundedPayment, SuccessfulPayment, SuggestedPostApprovalFailed, SuggestedPostApproved, SuggestedPostDeclined, SuggestedPostInfo, SuggestedPostPaid, SuggestedPostPrice, SuggestedPostRefunded, UniqueGiftInfo } from "./payment.js";
@@ -8,7 +8,7 @@ export declare namespace Message {
8
8
  interface ServiceMessage {
9
9
  /** Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
10
10
  message_id: number;
11
- /** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
11
+ /** Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only */
12
12
  message_thread_id?: number;
13
13
  /** Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats */
14
14
  from?: User;
@@ -20,7 +20,7 @@ export declare namespace Message {
20
20
  business_connection_id?: string;
21
21
  /** Chat the message belongs to */
22
22
  chat: Chat;
23
- /** True, if the message is sent to a forum topic */
23
+ /** True, if the message is sent to a topic in a forum supergroup or a private chat with the bot */
24
24
  is_topic_message?: boolean;
25
25
  /** Information about the direct messages chat topic that contains the message */
26
26
  direct_messages_topic?: DirectMessagesTopic;
@@ -106,6 +106,8 @@ export declare namespace Message {
106
106
  type SuggestedPostDeclinedMessage = ServiceMessage & MsgWith<"suggested_post_declined">;
107
107
  type SuggestedPostPaidMessage = ServiceMessage & MsgWith<"suggested_post_paid">;
108
108
  type SuggestedPostRefundedMessage = ServiceMessage & MsgWith<"suggested_post_refunded">;
109
+ type ChatOwnerLeftMessage = ServiceMessage & MsgWith<"chat_owner_left">;
110
+ type ChatOwnerChangedMessage = ServiceMessage & MsgWith<"chat_owner_changed">;
109
111
  type NewChatMembersMessage = ServiceMessage & MsgWith<"new_chat_members">;
110
112
  type LeftChatMemberMessage = ServiceMessage & MsgWith<"left_chat_member">;
111
113
  type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">;
@@ -141,6 +143,7 @@ export declare namespace Message {
141
143
  type GiveawayCompletedMessage = ServiceMessage & MsgWith<"giveaway_completed">;
142
144
  type GiftMessage = ServiceMessage & MsgWith<"gift">;
143
145
  type UniqueGiftMessage = ServiceMessage & MsgWith<"unique_gift">;
146
+ type GiftUpgradeSentMessage = ServiceMessage & MsgWith<"gift_upgrade_sent">;
144
147
  type PaidMessagePriceChangedMessage = ServiceMessage & MsgWith<"paid_message_price_changed">;
145
148
  type VideoChatScheduledMessage = ServiceMessage & MsgWith<"video_chat_scheduled">;
146
149
  type VideoChatStartedMessage = ServiceMessage & MsgWith<"video_chat_started">;
@@ -207,6 +210,10 @@ export interface Message extends Message.MediaMessage {
207
210
  suggested_post_paid?: SuggestedPostPaid;
208
211
  /** Service message: payment for a suggested post was refunded */
209
212
  suggested_post_refunded?: SuggestedPostRefunded;
213
+ /** Service message: chat owner has left */
214
+ chat_owner_left?: ChatOwnerLeft;
215
+ /** Service message: chat owner has changed */
216
+ chat_owner_changed?: ChatOwnerChanged;
210
217
  /** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
211
218
  new_chat_members?: User[];
212
219
  /** A member was removed from the group, information about them (this member may be the bot itself) */
@@ -274,6 +281,8 @@ export interface Message extends Message.MediaMessage {
274
281
  giveaway_completed?: GiveawayCompleted;
275
282
  /** Service message: a regular gift was sent or received */
276
283
  gift?: GiftInfo;
284
+ /** Service message: upgrade of a gift was purchased after the gift was sent */
285
+ gift_upgrade_sent?: GiftInfo;
277
286
  /** Service message: a unique gift was sent or received */
278
287
  unique_gift?: UniqueGiftInfo;
279
288
  /** Service message: the price for paid messages has changed in the chat */
@@ -370,7 +379,7 @@ Please note:
370
379
  - Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
371
380
  - Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
372
381
  - In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
373
- - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of an `underline` entity, so instead of `___italic underline___` use `___italic underline_**__`, adding an empty bold entity as a separator.
382
+ - In case of ambiguity between `italic` and `underline` entities `__` is always greedily treated from left to right as beginning or end of an `underline` entity, so instead of `___italic underline___` use `___italic underline_**__`, adding an empty bold entity as a separator.
374
383
  - A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.
375
384
  - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
376
385
 
@@ -424,12 +433,12 @@ Please note:
424
433
 
425
434
  - Entities must not be nested, use parse mode MarkdownV2 instead.
426
435
  - There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
427
- - To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
436
+ - To escape characters '_', '*', '`', '[' outside of an entity, prepend the character '\' before them.
428
437
  - Escaping inside entities is not allowed, so entity must be closed first and reopened again: use `_snake_\__case_` for italic `snake_case` and `*2*\**2=4*` for bold `2*2=4`. */
429
438
  export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
430
439
  export declare namespace MessageEntity {
431
440
  interface AbstractMessageEntity {
432
- /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
441
+ /** Type of the entity. Currently, can be “mention” (`@username`), “hashtag” (#hashtag or `#hashtag@chatusername`), “cashtag” ($USD or `$USD@chatusername`), “bot_command” (`/start@jobs_bot`), “url” (https://telegram.org), “email” (`do-not-reply@telegram.org`), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */
433
442
  type: string;
434
443
  /** Offset in UTF-16 code units to the start of the entity */
435
444
  offset: number;
@@ -530,7 +539,7 @@ export interface ExternalReplyInfo {
530
539
  export interface ReplyParameters {
531
540
  /** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
532
541
  message_id: number;
533
- /** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account and messages from channel direct messages chats. */
542
+ /** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format `@channelusername`). Not supported for messages sent on behalf of a business account and messages from channel direct messages chats. */
534
543
  chat_id?: number | string;
535
544
  /** Identifier of the specific checklist task to be replied to */
536
545
  checklist_task_id?: number;
@@ -695,6 +704,23 @@ export interface Video {
695
704
  mime_type?: string;
696
705
  /** File size in bytes */
697
706
  file_size?: number;
707
+ /** List of available qualities of the video. */
708
+ qualities?: VideoQuality[];
709
+ }
710
+ /** This object represents a video file of a specific quality. */
711
+ export interface VideoQuality {
712
+ /** Identifier for this file, which can be used to download or reuse the file */
713
+ file_id: string;
714
+ /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
715
+ file_unique_id: string;
716
+ /** Video width */
717
+ width: number;
718
+ /** Video height */
719
+ height: number;
720
+ /** Codec that was used to encode the video, for example, “h264”, “h265”, or “av01” */
721
+ codec: string;
722
+ /** File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */
723
+ file_size?: number;
698
724
  }
699
725
  /** This object represents a video message (available in Telegram apps as of v.4.0). */
700
726
  export interface VideoNote {
@@ -992,6 +1018,8 @@ export interface ChatBackground {
992
1018
  export interface ForumTopicCreated {
993
1019
  /** Name of the topic */
994
1020
  name: string;
1021
+ /** True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
1022
+ is_name_implicit?: true;
995
1023
  /** Color of the topic icon in RGB format */
996
1024
  icon_color: number;
997
1025
  /** Unique identifier of the custom emoji shown as the topic icon */