@grammyjs/types 3.6.2 → 3.8.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/markup.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ChatAdministratorRights, User } from "./manage.js";
2
2
  import type { MaybeInaccessibleMessage } from "./message.js";
3
- /** This object represents an inline keyboard that appears right next to the message it belongs to. */
3
+ /** This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. */
4
4
  export interface InlineKeyboardMarkup {
5
5
  /** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
6
6
  inline_keyboard: InlineKeyboardButton[][];
@@ -15,11 +15,11 @@ export declare namespace InlineKeyboardButton {
15
15
  url: string;
16
16
  }
17
17
  interface CallbackButton extends AbstractInlineKeyboardButton {
18
- /** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
18
+ /** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account. */
19
19
  callback_data: string;
20
20
  }
21
21
  interface WebAppButton extends AbstractInlineKeyboardButton {
22
- /** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. */
22
+ /** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account. */
23
23
  web_app: WebAppInfo;
24
24
  }
25
25
  interface LoginButton extends AbstractInlineKeyboardButton {
@@ -27,17 +27,17 @@ export declare namespace InlineKeyboardButton {
27
27
  login_url: LoginUrl;
28
28
  }
29
29
  interface SwitchInlineButton extends AbstractInlineKeyboardButton {
30
- /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted. */
30
+ /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account. */
31
31
  switch_inline_query: string;
32
32
  }
33
33
  interface SwitchInlineCurrentChatButton extends AbstractInlineKeyboardButton {
34
34
  /** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.
35
35
 
36
- This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. */
36
+ This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account. */
37
37
  switch_inline_query_current_chat: string;
38
38
  }
39
39
  interface SwitchInlineChosenChatButton extends AbstractInlineKeyboardButton {
40
- /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field */
40
+ /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account. */
41
41
  switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
42
42
  }
43
43
  interface GameButton extends AbstractInlineKeyboardButton {
@@ -47,7 +47,7 @@ export declare namespace InlineKeyboardButton {
47
47
  callback_game: CallbackGame;
48
48
  }
49
49
  interface PayButton extends AbstractInlineKeyboardButton {
50
- /** Specify True, to send a Pay button.
50
+ /** Specify True, to send a Pay button. Substrings “⭐” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
51
51
 
52
52
  NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
53
53
  pay: boolean;
@@ -104,7 +104,7 @@ export interface CallbackQuery {
104
104
  /** Short name of a Game to be returned, serves as the unique identifier for the game */
105
105
  game_short_name?: string;
106
106
  }
107
- /** This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). */
107
+ /** This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account. */
108
108
  export interface ReplyKeyboardMarkup {
109
109
  /** Array of button rows, each represented by an Array of KeyboardButton objects */
110
110
  keyboard: KeyboardButton[][];
@@ -151,14 +151,14 @@ export declare namespace KeyboardButton {
151
151
  web_app: WebAppInfo;
152
152
  }
153
153
  }
154
- /** This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive. */
154
+ /** 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. */
155
155
  export type KeyboardButton = KeyboardButton.CommonButton | KeyboardButton.RequestUsersButton | KeyboardButton.RequestChatButton | KeyboardButton.RequestContactButton | KeyboardButton.RequestLocationButton | KeyboardButton.RequestPollButton | KeyboardButton.WebAppButton | string;
156
156
  /** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
157
157
  export interface KeyboardButtonPollType {
158
158
  /** If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. */
159
159
  type?: "quiz" | "regular";
160
160
  }
161
- /** Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). */
161
+ /** Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account. */
162
162
  export interface ReplyKeyboardRemove {
163
163
  /** 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) */
164
164
  remove_keyboard: true;
@@ -167,7 +167,7 @@ export interface ReplyKeyboardRemove {
167
167
  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. */
168
168
  selective?: boolean;
169
169
  }
170
- /** Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
170
+ /** Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.
171
171
 
172
172
  Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:
173
173
 
@@ -199,11 +199,11 @@ export interface KeyboardButtonRequestUsers {
199
199
  user_is_premium?: boolean;
200
200
  /** The maximum number of users to be selected; 1-10. Defaults to 1. */
201
201
  max_quantity?: number;
202
- /** Pass True to request the users' first and last name */
202
+ /** Pass True to request the users' first and last names */
203
203
  request_name?: boolean;
204
- /** Pass True to request the users' username */
204
+ /** Pass True to request the users' usernames */
205
205
  request_username?: boolean;
206
- /** Pass True to request the users' photo */
206
+ /** Pass True to request the users' photos */
207
207
  request_photo?: boolean;
208
208
  }
209
209
  /** This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. */
package/message.d.ts CHANGED
@@ -45,12 +45,16 @@ export declare namespace Message {
45
45
  edit_date?: number;
46
46
  /** True, if the message can't be forwarded */
47
47
  has_protected_content?: true;
48
+ /** True, if the caption must be shown above the message media */
49
+ show_caption_above_media?: true;
48
50
  /** True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message */
49
51
  is_from_offline?: true;
50
52
  /** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
51
53
  author_signature?: string;
52
54
  /** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
53
55
  link_preview_options?: LinkPreviewOptions;
56
+ /** Unique identifier of the message effect added to the message */
57
+ effect_id?: string;
54
58
  /** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
55
59
  reply_markup?: InlineKeyboardMarkup;
56
60
  }
@@ -103,6 +107,7 @@ export declare namespace Message {
103
107
  type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">;
104
108
  type ProximityAlertTriggeredMessage = ServiceMessage & MsgWith<"proximity_alert_triggered">;
105
109
  type BoostAddedMessage = ServiceMessage & MsgWith<"boost_added">;
110
+ type ChatBackgroundSetMessage = ServiceMessage & MsgWith<"chat_background_set">;
106
111
  type ForumTopicCreatedMessage = ServiceMessage & MsgWith<"forum_topic_created">;
107
112
  type ForumTopicEditedMessage = ServiceMessage & MsgWith<"forum_topic_edited">;
108
113
  type ForumTopicClosedMessage = ServiceMessage & MsgWith<"forum_topic_closed">;
@@ -199,6 +204,7 @@ export interface Message extends Message.MediaMessage {
199
204
  proximity_alert_triggered?: ProximityAlertTriggered;
200
205
  /** Service message: user boosted the chat */
201
206
  boost_added?: ChatBoostAdded;
207
+ chat_background_set?: ChatBackground;
202
208
  /** Service message: forum topic created */
203
209
  forum_topic_created?: ForumTopicCreated;
204
210
  /** Service message: forum topic edited */
@@ -250,6 +256,7 @@ export interface InaccessibleMessage extends Omit<Message, "chat" | "message_id"
250
256
  date: 0;
251
257
  }
252
258
  /** This object describes a message that can be inaccessible to the bot. It can be one of
259
+
253
260
  - Message
254
261
  - InaccessibleMessage */
255
262
  export type MaybeInaccessibleMessage = Message | InaccessibleMessage;
@@ -260,7 +267,7 @@ Note that Telegram clients will display an **alert** to the user before opening
260
267
  Message entities can be nested, providing following restrictions are met:
261
268
  - If two entities have common characters, then one of them is fully contained inside another.
262
269
  - bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
263
- - blockquote entities can't be nested.
270
+ - blockquote and expandable_blockquote entities can't be nested.
264
271
  - All other entities can't contain each other.
265
272
 
266
273
  Links `tg://user?id=<user_id>` can be used to mention a user by their identifier without using a username. Please note:
@@ -292,9 +299,15 @@ pre-formatted fixed-width code block written in the Python programming language
292
299
  `​`​`
293
300
  >Block quotation started
294
301
  >Block quotation continued
295
- >The last line of the block quotation**
296
- >The second block quotation started right after the previous\r
297
- >The third block quotation started right after the previous
302
+ >Block quotation continued
303
+ >Block quotation continued
304
+ >The last line of the block quotation
305
+ ***>The second expandable block quotation started right after the previous
306
+ >It is separated from the previous block quotation by an empty bold entity
307
+ >Expandable block quotation continued
308
+ >Hidden by default part of the expandable block quotation started
309
+ >Expandable block quotation continued
310
+ >The last line of the expandable block quotation with the expandability mark||
298
311
  ```
299
312
  Please note:
300
313
 
@@ -302,7 +315,7 @@ Please note:
302
315
  - Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.
303
316
  - Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.
304
317
  - In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
305
- - In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of `underline` entity, so instead of `___italic underline___` use `___italic underline_\r__`, where `\r` is a character with code 13, which will be ignored.
318
+ - 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.
306
319
  - 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.
307
320
  - Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
308
321
 
@@ -323,6 +336,7 @@ To use this mode, pass *HTML* in the *parse_mode* field. The following tags are
323
336
  <pre>pre-formatted fixed-width code block</pre>
324
337
  <pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
325
338
  <blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>
339
+ <blockquote expandable>Expandable block quotation started\nExpandable block quotation continued\nExpandable block quotation continued\nHidden by default part of the block quotation started\nExpandable block quotation continued\nThe last line of the block quotation</blockquote>
326
340
  ```
327
341
  Please note:
328
342
 
@@ -354,13 +368,13 @@ pre-formatted fixed-width code block written in the Python programming language
354
368
  Please note:
355
369
 
356
370
  - Entities must not be nested, use parse mode MarkdownV2 instead.
357
- - There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
371
+ - There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote”, “expandable_blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.
358
372
  - To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
359
373
  - 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`. */
360
374
  export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
361
375
  export declare namespace MessageEntity {
362
376
  interface AbstractMessageEntity {
363
- /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “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), “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) */
377
+ /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “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) */
364
378
  type: string;
365
379
  /** Offset in UTF-16 code units to the start of the entity */
366
380
  offset: number;
@@ -368,7 +382,7 @@ export declare namespace MessageEntity {
368
382
  length: number;
369
383
  }
370
384
  interface CommonMessageEntity extends AbstractMessageEntity {
371
- type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "code";
385
+ type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "expandable_blockquote" | "code";
372
386
  }
373
387
  interface PreMessageEntity extends AbstractMessageEntity {
374
388
  type: "pre";
@@ -471,6 +485,7 @@ export interface ReplyParameters {
471
485
  quote_position?: number;
472
486
  }
473
487
  /** This object describes the origin of a message. It can be one of
488
+
474
489
  - MessageOriginUser
475
490
  - MessageOriginHiddenUser
476
491
  - MessageOriginChat
@@ -588,6 +603,13 @@ export interface Document {
588
603
  /** File size in bytes */
589
604
  file_size?: number;
590
605
  }
606
+ /** This object represents a story. */
607
+ export interface Story {
608
+ /** Chat that posted the story */
609
+ chat: Chat;
610
+ /** Unique identifier for the story in the chat */
611
+ id: number;
612
+ }
591
613
  /** This object represents a video file. */
592
614
  export interface Video {
593
615
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -661,9 +683,20 @@ export interface Dice {
661
683
  export interface PollOption {
662
684
  /** Option text, 1-100 characters */
663
685
  text: string;
686
+ /** Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts */
687
+ text_entities?: MessageEntity[];
664
688
  /** Number of users that voted for this option */
665
689
  voter_count: number;
666
690
  }
691
+ /** This object contains information about one answer option in a poll to send. */
692
+ export interface InputPollOption {
693
+ /** Option text, 1-100 characters */
694
+ text: string;
695
+ /** Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed */
696
+ text_parse_mode?: string;
697
+ /** A list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode */
698
+ text_entities?: MessageEntity[];
699
+ }
667
700
  /** This object represents an answer of a user in a non-anonymous poll. */
668
701
  export interface PollAnswer {
669
702
  /** Unique poll identifier */
@@ -681,6 +714,8 @@ export interface Poll {
681
714
  id: string;
682
715
  /** Poll question, 1-300 characters */
683
716
  question: string;
717
+ /** Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions */
718
+ question_entities?: MessageEntity[];
684
719
  /** List of poll options */
685
720
  options: PollOption[];
686
721
  /** Total number of users that voted in the poll */
@@ -736,12 +771,12 @@ export interface Venue {
736
771
  /** Google Places type of the venue. (See supported types.) */
737
772
  google_place_type?: string;
738
773
  }
739
- /** This object represents a story. */
740
- export interface Story {
741
- /** Chat that posted the story */
742
- chat: Chat;
743
- /** Unique identifier for the story in the chat */
744
- id: number;
774
+ /** Describes data sent from a Web App to the bot. */
775
+ export interface WebAppData {
776
+ /** The data. Be aware that a bad client can send arbitrary data in this field. */
777
+ data: string;
778
+ /** Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */
779
+ button_text: string;
745
780
  }
746
781
  /** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
747
782
  export interface ProximityAlertTriggered {
@@ -757,6 +792,99 @@ export interface MessageAutoDeleteTimerChanged {
757
792
  /** New auto-delete time for messages in the chat; in seconds */
758
793
  message_auto_delete_time: number;
759
794
  }
795
+ /** This object represents a service message about a user boosting a chat. */
796
+ export interface ChatBoostAdded {
797
+ /** Number of boosts added by the user */
798
+ boost_count: number;
799
+ }
800
+ /** This object describes the way a background is filled based on the selected colors. Currently, it can be one of
801
+
802
+ - BackgroundFillSolid
803
+ - BackgroundFillGradient
804
+ - BackgroundFillFreeformGradient */
805
+ export type BackgroundFill = BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient;
806
+ /** The background is filled using the selected color. */
807
+ export interface BackgroundFillSolid {
808
+ /** Type of the background fill, always “solid” */
809
+ type: "solid";
810
+ /** The color of the background fill in the RGB24 format */
811
+ color: number;
812
+ }
813
+ /** The background is a gradient fill. */
814
+ export interface BackgroundFillGradient {
815
+ /** Type of the background fill, always “gradient” */
816
+ type: "gradient";
817
+ /** Top color of the gradient in the RGB24 format */
818
+ top_color: number;
819
+ /** Bottom color of the gradient in the RGB24 format */
820
+ bottom_color: number;
821
+ /** Clockwise rotation angle of the background fill in degrees; 0-359 */
822
+ rotation_angle: number;
823
+ }
824
+ /** The background is a freeform gradient that rotates after every message in the chat. */
825
+ export interface BackgroundFillFreeformGradient {
826
+ /** Type of the background fill, always “freeform_gradient” */
827
+ type: "freeform_gradient";
828
+ /** A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format */
829
+ colors: number[];
830
+ }
831
+ /** This object describes the type of a background. Currently, it can be one of
832
+
833
+ - BackgroundTypeFill
834
+ - BackgroundTypeWallpaper
835
+ - BackgroundTypePattern
836
+ - BackgroundTypeChatTheme
837
+ - BackgroundTypeFill */
838
+ export type BackgroundType = BackgroundTypeFill | BackgroundTypeWallpaper | BackgroundTypePattern | BackgroundTypeChatTheme;
839
+ /** The background is automatically filled based on the selected colors. */
840
+ export interface BackgroundTypeFill {
841
+ /** Type of the background, always “fill” */
842
+ type: "fill";
843
+ /** The background fill */
844
+ fill: BackgroundFill;
845
+ /** Dimming of the background in dark themes, as a percentage; 0-100 */
846
+ dark_theme_dimming: number;
847
+ }
848
+ /** The background is a wallpaper in the JPEG format. */
849
+ export interface BackgroundTypeWallpaper {
850
+ /** Type of the background, always “wallpaper” */
851
+ type: "wallpaper";
852
+ /** Document with the wallpaper */
853
+ document: Document;
854
+ /** Dimming of the background in dark themes, as a percentage; 0-100 */
855
+ dark_theme_dimming: number;
856
+ /** True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 */
857
+ is_blurred?: true;
858
+ /** True, if the background moves slightly when the device is tilted */
859
+ is_moving?: true;
860
+ }
861
+ /** The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
862
+ export interface BackgroundTypePattern {
863
+ /** Type of the background, always “pattern” */
864
+ type: "pattern";
865
+ /** Document with the pattern */
866
+ document: Document;
867
+ /** The background fill that is combined with the pattern */
868
+ fill: BackgroundFill;
869
+ /** Intensity of the pattern when it is shown above the filled background; 0-100 */
870
+ intensity: number;
871
+ /** True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only */
872
+ is_inverted?: true;
873
+ /** True, if the background moves slightly when the device is tilted */
874
+ is_moving?: true;
875
+ }
876
+ /** The background is taken directly from a built-in chat theme. */
877
+ export interface BackgroundTypeChatTheme {
878
+ /** Type of the background, always “chat_theme” */
879
+ type: "chat_theme";
880
+ /** Name of the chat theme, which is usually an emoji */
881
+ theme_name: string;
882
+ }
883
+ /** This object represents a chat background. */
884
+ export interface ChatBackground {
885
+ /** Type of the background*/
886
+ type: BackgroundType;
887
+ }
760
888
  /** This object represents a service message about a new forum topic created in the chat. */
761
889
  export interface ForumTopicCreated {
762
890
  /** Name of the topic */
@@ -785,14 +913,9 @@ export interface GeneralForumTopicHidden {
785
913
  /** This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. */
786
914
  export interface GeneralForumTopicUnhidden {
787
915
  }
788
- /** This object represents a service message about a user boosting a chat. */
789
- export interface ChatBoostAdded {
790
- /** Number of boosts added by the user */
791
- boost_count: number;
792
- }
793
- /** This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button. */
916
+ /** This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button. */
794
917
  export interface SharedUser {
795
- /** Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
918
+ /** Identifier of the shared user. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
796
919
  user_id: number;
797
920
  /** First name of the user, if the name was requested by the bot */
798
921
  first_name?: string;
@@ -919,13 +1042,6 @@ export interface LinkPreviewOptions {
919
1042
  /** True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text */
920
1043
  show_above_text?: boolean;
921
1044
  }
922
- /** Describes data sent from a Web App to the bot. */
923
- export interface WebAppData {
924
- /** The data. Be aware that a bad client can send arbitrary data in this field. */
925
- data: string;
926
- /** Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */
927
- button_text: string;
928
- }
929
1045
  /** This object represents a sticker. */
930
1046
  export interface Sticker {
931
1047
  /** Identifier for this file, which can be used to download or reuse the file */
@@ -1016,7 +1132,10 @@ export interface File {
1016
1132
  /** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
1017
1133
  file_path?: string;
1018
1134
  }
1019
- /** This object describes the type of a reaction. Currently, it can be one of */
1135
+ /** This object describes the type of a reaction. Currently, it can be one of
1136
+
1137
+ - ReactionTypeEmoji
1138
+ - ReactionTypeCustomEmoji */
1020
1139
  export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji;
1021
1140
  /** The reaction is based on an emoji. */
1022
1141
  export interface ReactionTypeEmoji {