@telegram.ts/types 1.24.0 → 1.25.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.
@@ -6,6 +6,7 @@ import type {
6
6
  Sticker,
7
7
  } from "./messageTypes";
8
8
  import type { LanguageCode } from "./languageTypes";
9
+ import type { UniqueGiftColors } from "./invoiceTypes";
9
10
  import type { Update } from "./updateTypes";
10
11
 
11
12
  /** Describes the current status of a webhook. */
@@ -40,6 +41,8 @@ export interface AcceptedGiftTypes {
40
41
  unique_gifts: boolean;
41
42
  /** True, if a Telegram Premium subscription is accepted */
42
43
  premium_subscription: boolean;
44
+ /** True, if transfers of unique gifts from channels are accepted */
45
+ gifts_from_channels: boolean;
43
46
  }
44
47
 
45
48
  /** This object represents a Telegram user or bot. */
@@ -55,7 +58,7 @@ export interface User {
55
58
  /** User's or bot's username */
56
59
  username?: string;
57
60
  /** IETF language tag of the user's language */
58
- language_code?: LanguageCode;
61
+ language_code?: string;
59
62
  /** True, if this user is a Telegram Premium user */
60
63
  is_premium?: true;
61
64
  /** True, if this user added the bot to the attachment menu */
@@ -76,6 +79,20 @@ export interface UserFromGetMe extends User {
76
79
  can_connect_to_business: boolean;
77
80
  /** True, if the bot has main Web App. Returned only in getMe. */
78
81
  has_main_web_app: boolean;
82
+ /** True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. */
83
+ has_topics_enabled?: boolean;
84
+ }
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;
79
96
  }
80
97
 
81
98
  export declare namespace Chat {
@@ -173,14 +190,16 @@ export declare namespace ChatFullInfo {
173
190
  type: "private";
174
191
  /** Title, for supergroups, channels and group chats */
175
192
  title?: undefined;
176
- /** Username, for private chats, supergroups and channels if available */
193
+ /** Username, for private chats, supergroups and channels if available */
177
194
  username?: string;
178
- /** First name of the other party in a private chat */
195
+ /** First name of the other party in a private chat */
179
196
  first_name: string;
180
- /** Last name of the other party in a private chat */
197
+ /** Last name of the other party in a private chat */
181
198
  last_name?: string;
182
199
  /** True, if the supergroup chat is a forum (has topics enabled) */
183
200
  is_forum?: undefined;
201
+ /** True, if the chat is the direct messages chat of a channel */
202
+ is_direct_messages?: undefined;
184
203
  /** 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. */
185
204
  accent_color_id: number;
186
205
  /** The maximum number of reactions that can be set on a message in the chat */
@@ -197,8 +216,14 @@ export declare namespace ChatFullInfo {
197
216
  business_location?: BusinessLocation;
198
217
  /** For private chats with business accounts, the opening hours of the business */
199
218
  business_opening_hours?: BusinessOpeningHours;
219
+ /** For private chats, the rating of the user if any */
220
+ rating?: UserRating;
221
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
222
+ unique_gift_colors?: UniqueGiftColors;
200
223
  /** For private chats, the personal channel of the user */
201
224
  personal_chat?: Chat;
225
+ /** Information about the corresponding channel chat; for direct messages chats only */
226
+ parent_chat?: undefined;
202
227
  /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
203
228
  available_reactions?: ReactionType[];
204
229
  /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -207,7 +232,7 @@ export declare namespace ChatFullInfo {
207
232
  profile_accent_color_id?: number;
208
233
  /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
209
234
  profile_background_custom_emoji_id?: string;
210
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
235
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
211
236
  emoji_status_custom_emoji_id?: string;
212
237
  /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
213
238
  emoji_status_expiration_date?: number;
@@ -223,7 +248,7 @@ export declare namespace ChatFullInfo {
223
248
  join_by_request?: undefined;
224
249
  /** Description, for groups, supergroups and channel chats */
225
250
  description?: undefined;
226
- /** Primary invite link, for groups, supergroups and channel chats */
251
+ /** Primary invite link, for groups, supergroups and channel chats */
227
252
  invite_link?: undefined;
228
253
  /** The most recent pinned message (by sending date) */
229
254
  pinned_message?: Message;
@@ -231,11 +256,13 @@ export declare namespace ChatFullInfo {
231
256
  permissions?: undefined;
232
257
  /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
233
258
  accepted_gift_types: AcceptedGiftTypes;
259
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
260
+ can_send_paid_media?: undefined;
234
261
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
235
262
  slow_mode_delay?: undefined;
236
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
263
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
237
264
  unrestrict_boost_count?: undefined;
238
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
265
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
239
266
  message_auto_delete_time?: number;
240
267
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
241
268
  has_aggressive_anti_spam_enabled?: undefined;
@@ -253,12 +280,8 @@ export declare namespace ChatFullInfo {
253
280
  custom_emoji_sticker_set_name?: undefined;
254
281
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
255
282
  linked_chat_id?: undefined;
256
- /** Information about the corresponding channel chat; for direct messages chats only */
257
- parent_chat?: undefined;
258
283
  /** For supergroups, the location to which the supergroup is connected */
259
284
  location?: undefined;
260
- /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
261
- can_send_paid_media?: undefined;
262
285
  }
263
286
  /** Internal type for group chats */
264
287
  export interface GroupChat {
@@ -268,14 +291,16 @@ export declare namespace ChatFullInfo {
268
291
  type: "group";
269
292
  /** Title, for supergroups, channels and group chats */
270
293
  title: string;
271
- /** Username, for private chats, supergroups and channels if available */
294
+ /** Username, for private chats, supergroups and channels if available */
272
295
  username?: undefined;
273
- /** First name of the other party in a private chat */
296
+ /** First name of the other party in a private chat */
274
297
  first_name?: undefined;
275
- /** Last name of the other party in a private chat */
298
+ /** Last name of the other party in a private chat */
276
299
  last_name?: undefined;
277
300
  /** True, if the supergroup chat is a forum (has topics enabled) */
278
301
  is_forum?: undefined;
302
+ /** True, if the chat is the direct messages chat of a channel */
303
+ is_direct_messages?: undefined;
279
304
  /** 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. */
280
305
  accent_color_id: number;
281
306
  /** The maximum number of reactions that can be set on a message in the chat */
@@ -292,8 +317,14 @@ export declare namespace ChatFullInfo {
292
317
  business_location?: undefined;
293
318
  /** For private chats with business accounts, the opening hours of the business */
294
319
  business_opening_hours?: undefined;
320
+ /** For private chats, the rating of the user if any */
321
+ rating?: undefined;
322
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
323
+ unique_gift_colors?: UniqueGiftColors;
295
324
  /** For private chats, the personal channel of the user */
296
325
  personal_chat?: undefined;
326
+ /** Information about the corresponding channel chat; for direct messages chats only */
327
+ parent_chat?: undefined;
297
328
  /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
298
329
  available_reactions?: ReactionType[];
299
330
  /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -302,7 +333,7 @@ export declare namespace ChatFullInfo {
302
333
  profile_accent_color_id?: number;
303
334
  /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
304
335
  profile_background_custom_emoji_id?: string;
305
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
336
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
306
337
  emoji_status_custom_emoji_id?: string;
307
338
  /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
308
339
  emoji_status_expiration_date?: number;
@@ -318,19 +349,21 @@ export declare namespace ChatFullInfo {
318
349
  join_by_request?: undefined;
319
350
  /** Description, for groups, supergroups and channel chats */
320
351
  description?: string;
321
- /** Primary invite link, for groups, supergroups and channel chats */
352
+ /** Primary invite link, for groups, supergroups and channel chats */
322
353
  invite_link?: string;
323
354
  /** The most recent pinned message (by sending date) */
324
355
  pinned_message?: Message;
325
356
  /** Default chat member permissions, for groups and supergroups */
326
357
  permissions?: ChatPermissions;
327
- /** True, if gifts can be sent to the chat */
328
- can_send_gift?: true;
358
+ /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
359
+ accepted_gift_types: AcceptedGiftTypes;
360
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
361
+ can_send_paid_media?: undefined;
329
362
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
330
363
  slow_mode_delay?: undefined;
331
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
364
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
332
365
  unrestrict_boost_count?: undefined;
333
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
366
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
334
367
  message_auto_delete_time?: number;
335
368
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
336
369
  has_aggressive_anti_spam_enabled?: undefined;
@@ -348,12 +381,8 @@ export declare namespace ChatFullInfo {
348
381
  custom_emoji_sticker_set_name?: undefined;
349
382
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
350
383
  linked_chat_id?: undefined;
351
- /** Information about the corresponding channel chat; for direct messages chats only */
352
- parent_chat?: undefined;
353
384
  /** For supergroups, the location to which the supergroup is connected */
354
385
  location?: undefined;
355
- /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
356
- can_send_paid_media?: undefined;
357
386
  }
358
387
  /** Internal type for supergroup chats */
359
388
  export interface SupergroupChat {
@@ -363,14 +392,16 @@ export declare namespace ChatFullInfo {
363
392
  type: "supergroup";
364
393
  /** Title, for supergroups, channels and group chats */
365
394
  title: string;
366
- /** Username, for private chats, supergroups and channels if available */
395
+ /** Username, for private chats, supergroups and channels if available */
367
396
  username?: string;
368
- /** First name of the other party in a private chat */
397
+ /** First name of the other party in a private chat */
369
398
  first_name?: undefined;
370
- /** Last name of the other party in a private chat */
399
+ /** Last name of the other party in a private chat */
371
400
  last_name?: undefined;
372
401
  /** True, if the supergroup chat is a forum (has topics enabled) */
373
402
  is_forum?: true;
403
+ /** True, if the chat is the direct messages chat of a channel */
404
+ is_direct_messages?: true;
374
405
  /** 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. */
375
406
  accent_color_id: number;
376
407
  /** The maximum number of reactions that can be set on a message in the chat */
@@ -387,8 +418,14 @@ export declare namespace ChatFullInfo {
387
418
  business_location?: undefined;
388
419
  /** For private chats with business accounts, the opening hours of the business */
389
420
  business_opening_hours?: undefined;
421
+ /** For private chats, the rating of the user if any */
422
+ rating?: undefined;
423
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
424
+ unique_gift_colors?: UniqueGiftColors;
390
425
  /** For private chats, the personal channel of the user */
391
426
  personal_chat?: undefined;
427
+ /** Information about the corresponding channel chat; for direct messages chats only */
428
+ parent_chat?: Chat.ChannelChat;
392
429
  /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
393
430
  available_reactions?: ReactionType[];
394
431
  /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -397,7 +434,7 @@ export declare namespace ChatFullInfo {
397
434
  profile_accent_color_id?: number;
398
435
  /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
399
436
  profile_background_custom_emoji_id?: string;
400
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
437
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
401
438
  emoji_status_custom_emoji_id?: string;
402
439
  /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
403
440
  emoji_status_expiration_date?: number;
@@ -413,19 +450,21 @@ export declare namespace ChatFullInfo {
413
450
  join_by_request?: true;
414
451
  /** Description, for groups, supergroups and channel chats */
415
452
  description?: string;
416
- /** Primary invite link, for groups, supergroups and channel chats */
453
+ /** Primary invite link, for groups, supergroups and channel chats */
417
454
  invite_link?: string;
418
455
  /** The most recent pinned message (by sending date) */
419
456
  pinned_message?: Message;
420
457
  /** Default chat member permissions, for groups and supergroups */
421
458
  permissions?: ChatPermissions;
422
- /** True, if gifts can be sent to the chat */
423
- can_send_gift?: true;
459
+ /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
460
+ accepted_gift_types: AcceptedGiftTypes;
461
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
462
+ can_send_paid_media?: undefined;
424
463
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
425
464
  slow_mode_delay?: number;
426
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
465
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
427
466
  unrestrict_boost_count?: number;
428
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
467
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
429
468
  message_auto_delete_time?: number;
430
469
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
431
470
  has_aggressive_anti_spam_enabled?: true;
@@ -443,12 +482,8 @@ export declare namespace ChatFullInfo {
443
482
  custom_emoji_sticker_set_name?: string;
444
483
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
445
484
  linked_chat_id?: number;
446
- /** Information about the corresponding channel chat; for direct messages chats only */
447
- parent_chat?: Chat.ChannelChat;
448
485
  /** For supergroups, the location to which the supergroup is connected */
449
486
  location?: ChatLocation;
450
- /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
451
- can_send_paid_media?: undefined;
452
487
  }
453
488
  /** Internal type for channel chats */
454
489
  export interface ChannelChat {
@@ -458,14 +493,16 @@ export declare namespace ChatFullInfo {
458
493
  type: "channel";
459
494
  /** Title, for supergroups, channels and group chats */
460
495
  title: string;
461
- /** Username, for private chats, supergroups and channels if available */
496
+ /** Username, for private chats, supergroups and channels if available */
462
497
  username?: string;
463
- /** First name of the other party in a private chat */
498
+ /** First name of the other party in a private chat */
464
499
  first_name?: undefined;
465
- /** Last name of the other party in a private chat */
500
+ /** Last name of the other party in a private chat */
466
501
  last_name?: undefined;
467
502
  /** True, if the supergroup chat is a forum (has topics enabled) */
468
503
  is_forum?: undefined;
504
+ /** True, if the chat is the direct messages chat of a channel */
505
+ is_direct_messages?: undefined;
469
506
  /** 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. */
470
507
  accent_color_id: number;
471
508
  /** The maximum number of reactions that can be set on a message in the chat */
@@ -482,8 +519,14 @@ export declare namespace ChatFullInfo {
482
519
  business_location?: undefined;
483
520
  /** For private chats with business accounts, the opening hours of the business */
484
521
  business_opening_hours?: undefined;
522
+ /** For private chats, the rating of the user if any */
523
+ rating?: undefined;
524
+ /** The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
525
+ unique_gift_colors?: UniqueGiftColors;
485
526
  /** For private chats, the personal channel of the user */
486
527
  personal_chat?: undefined;
528
+ /** Information about the corresponding channel chat; for direct messages chats only */
529
+ parent_chat?: undefined;
487
530
  /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
488
531
  available_reactions?: ReactionType[];
489
532
  /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
@@ -492,7 +535,7 @@ export declare namespace ChatFullInfo {
492
535
  profile_accent_color_id?: number;
493
536
  /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
494
537
  profile_background_custom_emoji_id?: string;
495
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
538
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
496
539
  emoji_status_custom_emoji_id?: string;
497
540
  /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
498
541
  emoji_status_expiration_date?: number;
@@ -508,19 +551,21 @@ export declare namespace ChatFullInfo {
508
551
  join_by_request?: undefined;
509
552
  /** Description, for groups, supergroups and channel chats */
510
553
  description?: string;
511
- /** Primary invite link, for groups, supergroups and channel chats */
554
+ /** Primary invite link, for groups, supergroups and channel chats */
512
555
  invite_link?: string;
513
556
  /** The most recent pinned message (by sending date) */
514
557
  pinned_message?: Message;
515
558
  /** Default chat member permissions, for groups and supergroups */
516
559
  permissions?: undefined;
517
- /** True, if gifts can be sent to the chat */
518
- can_send_gift?: true;
560
+ /** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
561
+ accepted_gift_types: AcceptedGiftTypes;
562
+ /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
563
+ can_send_paid_media?: true;
519
564
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
520
565
  slow_mode_delay?: undefined;
521
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
566
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
522
567
  unrestrict_boost_count?: undefined;
523
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
568
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
524
569
  message_auto_delete_time?: number;
525
570
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
526
571
  has_aggressive_anti_spam_enabled?: undefined;
@@ -538,12 +583,8 @@ export declare namespace ChatFullInfo {
538
583
  custom_emoji_sticker_set_name?: undefined;
539
584
  /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
540
585
  linked_chat_id?: number;
541
- /** Information about the corresponding channel chat; for direct messages chats only */
542
- parent_chat?: undefined;
543
586
  /** For supergroups, the location to which the supergroup is connected */
544
587
  location?: undefined;
545
- /** True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
546
- can_send_paid_media?: undefined;
547
588
  }
548
589
  }
549
590
 
@@ -903,6 +944,8 @@ export interface ForumTopic {
903
944
  message_thread_id: number;
904
945
  /** Name of the topic */
905
946
  name: string;
947
+ /** True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
948
+ is_name_implicit?: true;
906
949
  /** Color of the topic icon in RGB format */
907
950
  icon_color: number;
908
951
  /** Unique identifier of the custom emoji shown as the topic icon */
@@ -29,7 +29,7 @@ export declare namespace Message {
29
29
  interface ServiceMessage {
30
30
  /** 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 */
31
31
  message_id: number;
32
- /** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
32
+ /** Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only */
33
33
  message_thread_id?: number;
34
34
  /** 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. */
35
35
  from?: User;
@@ -41,7 +41,7 @@ export declare namespace Message {
41
41
  business_connection_id?: string;
42
42
  /** Chat the message belongs to */
43
43
  chat: Chat;
44
- /** True, if the message is sent to a forum topic */
44
+ /** True, if the message is sent to a topic in a forum supergroup or a private chat with the bot */
45
45
  is_topic_message?: boolean;
46
46
  /** Information about the direct messages chat topic that contains the message */
47
47
  direct_messages_topic?: DirectMessagesTopic;
@@ -101,7 +101,9 @@ export declare namespace Message {
101
101
  has_media_spoiler?: true;
102
102
  }
103
103
 
104
- export type TextMessage = CommonMessage & MsgWith<"text">;
104
+ export type TextMessage = CommonMessage &
105
+ MsgWith<"text"> &
106
+ Partial<MsgWith<"entities">>;
105
107
  export type AudioMessage = CaptionableMessage & MsgWith<"audio">;
106
108
  export type DocumentMessage = CaptionableMessage & MsgWith<"document">;
107
109
  export type AnimationMessage = DocumentMessage & MsgWith<"animation">;
@@ -196,6 +198,8 @@ export declare namespace Message {
196
198
  MsgWith<"giveaway_completed">;
197
199
  export type GiftMessage = ServiceMessage & MsgWith<"gift">;
198
200
  export type UniqueGiftMessage = ServiceMessage & MsgWith<"unique_gift">;
201
+ export type GiftUpgradeSentMessage = ServiceMessage &
202
+ MsgWith<"gift_upgrade_sent">;
199
203
  export type PaidMessagePriceChangedMessage = ServiceMessage &
200
204
  MsgWith<"paid_message_price_changed">;
201
205
  export type VideoChatScheduledMessage = ServiceMessage &
@@ -334,6 +338,8 @@ export interface Message extends Message.MediaMessage {
334
338
  giveaway_completed?: GiveawayCompleted;
335
339
  /** Service message: a regular gift was sent or received */
336
340
  gift?: GiftInfo;
341
+ /** Service message: upgrade of a gift was purchased after the gift was sent */
342
+ gift_upgrade_sent?: GiftInfo;
337
343
  /** Service message: a unique gift was sent or received */
338
344
  unique_gift?: UniqueGiftInfo;
339
345
  /** Service message: the price for paid messages has changed in the chat */
@@ -442,7 +448,7 @@ Please note:
442
448
  - Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
443
449
  - Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
444
450
  - In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
445
- - 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.
451
+ - 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.
446
452
  - 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.
447
453
  - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
448
454
 
@@ -496,7 +502,7 @@ Please note:
496
502
 
497
503
  - Entities must not be nested, use parse mode MarkdownV2 instead.
498
504
  - There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
499
- - To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
505
+ - To escape character '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
500
506
  - 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`. */
501
507
  export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
502
508
 
@@ -1028,6 +1034,8 @@ export interface MessageAutoDeleteTimerChanged {
1028
1034
  export interface ForumTopicCreated {
1029
1035
  /** Name of the topic */
1030
1036
  name: string;
1037
+ /** True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
1038
+ is_name_implicit?: true;
1031
1039
  /** Color of the topic icon in RGB format */
1032
1040
  icon_color: number;
1033
1041
  /** Unique identifier of the custom emoji shown as the topic icon */