@mtkruto/node 0.0.957 → 0.0.960

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.
Files changed (93) hide show
  1. package/esm/client/0_utilities.d.ts +3 -0
  2. package/esm/client/0_utilities.js +20 -0
  3. package/esm/client/3_client.d.ts +2 -2
  4. package/esm/client/3_client.js +57 -16
  5. package/esm/constants.d.ts +1 -1
  6. package/esm/constants.js +1 -1
  7. package/esm/storage/0_storage.d.ts +16 -17
  8. package/esm/storage/0_storage.js +65 -131
  9. package/esm/storage/0_utilities.d.ts +13 -0
  10. package/esm/storage/0_utilities.js +62 -0
  11. package/esm/storage/1_storage_indexed_db.d.ts +3 -3
  12. package/esm/storage/1_storage_indexed_db.js +4 -3
  13. package/esm/storage/1_storage_local_storage.d.ts +3 -3
  14. package/esm/storage/1_storage_local_storage.js +13 -6
  15. package/esm/storage/1_storage_memory.d.ts +4 -4
  16. package/esm/storage/1_storage_memory.js +4 -2
  17. package/esm/storage/1_storage_session_storage.d.ts +3 -3
  18. package/esm/storage/1_storage_session_storage.js +13 -6
  19. package/esm/types/0_audio.d.ts +9 -0
  20. package/esm/types/0_chat_administrator_rights.d.ts +4 -4
  21. package/esm/types/0_contact.d.ts +6 -0
  22. package/esm/types/0_dice.d.ts +3 -0
  23. package/esm/types/0_force_reply.d.ts +1 -1
  24. package/esm/types/0_keyboard_button_poll_type.d.ts +1 -1
  25. package/esm/types/0_location.d.ts +7 -0
  26. package/esm/types/0_login_url.d.ts +3 -3
  27. package/esm/types/0_mask_position.d.ts +5 -0
  28. package/esm/types/0_message_entity.d.ts +4 -4
  29. package/esm/types/0_reply_keyboard_remove.d.ts +1 -1
  30. package/esm/types/0_thumbnail.d.ts +2 -1
  31. package/esm/types/0_venue.d.ts +6 -0
  32. package/esm/types/0_voice.d.ts +6 -0
  33. package/esm/types/1_animation.d.ts +10 -0
  34. package/esm/types/1_chat.d.ts +18 -18
  35. package/esm/types/1_document.d.ts +7 -0
  36. package/esm/types/1_inline_keyboard_button.d.ts +7 -7
  37. package/esm/types/1_keyboard_button.d.ts +14 -14
  38. package/esm/types/1_photo.d.ts +2 -1
  39. package/esm/types/1_sticker.d.ts +16 -0
  40. package/esm/types/1_user.d.ts +7 -7
  41. package/esm/types/1_video.d.ts +10 -0
  42. package/esm/types/1_video_note.d.ts +8 -0
  43. package/esm/types/2_game.d.ts +7 -0
  44. package/esm/types/2_reply_keyboard_markup.d.ts +5 -5
  45. package/esm/types/3_message.d.ts +57 -25
  46. package/esm/types/3_message.js +0 -1
  47. package/package.json +1 -1
  48. package/script/client/0_utilities.d.ts +3 -0
  49. package/script/client/0_utilities.js +48 -0
  50. package/script/client/3_client.d.ts +2 -2
  51. package/script/client/3_client.js +57 -16
  52. package/script/constants.d.ts +1 -1
  53. package/script/constants.js +1 -1
  54. package/script/storage/0_storage.d.ts +16 -17
  55. package/script/storage/0_storage.js +65 -131
  56. package/script/storage/0_utilities.d.ts +13 -0
  57. package/script/storage/0_utilities.js +68 -0
  58. package/script/storage/1_storage_indexed_db.d.ts +3 -3
  59. package/script/storage/1_storage_indexed_db.js +4 -3
  60. package/script/storage/1_storage_local_storage.d.ts +3 -3
  61. package/script/storage/1_storage_local_storage.js +13 -6
  62. package/script/storage/1_storage_memory.d.ts +4 -4
  63. package/script/storage/1_storage_memory.js +4 -2
  64. package/script/storage/1_storage_session_storage.d.ts +3 -3
  65. package/script/storage/1_storage_session_storage.js +13 -6
  66. package/script/types/0_audio.d.ts +9 -0
  67. package/script/types/0_chat_administrator_rights.d.ts +4 -4
  68. package/script/types/0_contact.d.ts +6 -0
  69. package/script/types/0_dice.d.ts +3 -0
  70. package/script/types/0_force_reply.d.ts +1 -1
  71. package/script/types/0_keyboard_button_poll_type.d.ts +1 -1
  72. package/script/types/0_location.d.ts +7 -0
  73. package/script/types/0_login_url.d.ts +3 -3
  74. package/script/types/0_mask_position.d.ts +5 -0
  75. package/script/types/0_message_entity.d.ts +4 -4
  76. package/script/types/0_reply_keyboard_remove.d.ts +1 -1
  77. package/script/types/0_thumbnail.d.ts +2 -1
  78. package/script/types/0_venue.d.ts +6 -0
  79. package/script/types/0_voice.d.ts +6 -0
  80. package/script/types/1_animation.d.ts +10 -0
  81. package/script/types/1_chat.d.ts +18 -18
  82. package/script/types/1_document.d.ts +7 -0
  83. package/script/types/1_inline_keyboard_button.d.ts +7 -7
  84. package/script/types/1_keyboard_button.d.ts +14 -14
  85. package/script/types/1_photo.d.ts +2 -1
  86. package/script/types/1_sticker.d.ts +16 -0
  87. package/script/types/1_user.d.ts +7 -7
  88. package/script/types/1_video.d.ts +10 -0
  89. package/script/types/1_video_note.d.ts +8 -0
  90. package/script/types/2_game.d.ts +7 -0
  91. package/script/types/2_reply_keyboard_markup.d.ts +5 -5
  92. package/script/types/3_message.d.ts +57 -25
  93. package/script/types/3_message.js +0 -1
@@ -2,10 +2,10 @@
2
2
  export interface LoginUrl {
3
3
  /** An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in [Receiving authorization data](https://core.telegram.org/widgets/login#receiving-authorization-data). */
4
4
  url: string;
5
- /** Optional. New text of the button in forwarded messages. */
5
+ /** New text of the button in forwarded messages. */
6
6
  forwardText?: string;
7
- /** Optional. Username of a bot, which will be used for user authorization. See [Setting up a bot](https://core.telegram.org/widgets/login#setting-up-a-bot) for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See [Linking your domain to the bot](https://core.telegram.org/widgets/login#linking-your-domain-to-the-bot) for more details. */
7
+ /** Username of a bot, which will be used for user authorization. See [Setting up a bot](https://core.telegram.org/widgets/login#setting-up-a-bot) for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See [Linking your domain to the bot](https://core.telegram.org/widgets/login#linking-your-domain-to-the-bot) for more details. */
8
8
  botUsername?: string;
9
- /** Optional. Pass True to request the permission for your bot to send messages to the user. */
9
+ /** Pass True to request the permission for your bot to send messages to the user. */
10
10
  requestWriteAccess?: boolean;
11
11
  }
@@ -1,8 +1,13 @@
1
1
  import * as types from "../tl/2_types.js";
2
+ /** This object describes the position on faces where a mask should be placed by default. */
2
3
  export interface MaskPosition {
4
+ /** The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin". */
3
5
  point: "forehead" | "eyes" | "mouth" | "chin";
6
+ /** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */
4
7
  xShift: number;
8
+ /** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */
5
9
  yShift: number;
10
+ /** Mask scaling coefficient. For example, 2.0 means double size. */
6
11
  scale: number;
7
12
  }
8
13
  export declare function constructMaskPosition({ n, x, y, zoom }: types.MaskCoords): MaskPosition;
@@ -50,7 +50,7 @@ export declare namespace MessageEntity {
50
50
  }
51
51
  interface Pre extends Base {
52
52
  type: MessageEntityType.Pre;
53
- /** Optional. For “pre” only, the programming language of the entity text */
53
+ /** For “pre” only, the programming language of the entity text */
54
54
  language: string;
55
55
  }
56
56
  interface Code extends Base {
@@ -58,12 +58,12 @@ export declare namespace MessageEntity {
58
58
  }
59
59
  interface TextURL extends Base {
60
60
  type: MessageEntityType.TextURL;
61
- /** Optional. For “text_link” only, URL that will be opened after user taps on the text */
61
+ /** For “text_link” only, URL that will be opened after user taps on the text */
62
62
  url: string;
63
63
  }
64
64
  interface MentionName extends Base {
65
65
  type: MessageEntityType.MentionName;
66
- /** Optional. For “text_mention” only, the ID of the mentioned user */
66
+ /** For “text_mention” only, the ID of the mentioned user */
67
67
  userId: number;
68
68
  }
69
69
  interface Cashtag extends Base {
@@ -89,7 +89,7 @@ export declare namespace MessageEntity {
89
89
  }
90
90
  interface CustomEmoji extends Base {
91
91
  type: MessageEntityType.CustomEmoji;
92
- /** Optional. For “custom_emoji” only, unique identifier of the custom emoji */
92
+ /** For “custom_emoji” only, unique identifier of the custom emoji */
93
93
  customEmojiId: string;
94
94
  }
95
95
  }
@@ -3,7 +3,7 @@ import * as types from "../tl/2_types.js";
3
3
  export interface ReplyKeyboardRemove {
4
4
  /** 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`) */
5
5
  removeKeyboard: true;
6
- /** Optional. 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 (has _reply_to_message_id_), sender of the original message. */
6
+ /** 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 (has _reply_to_message_id_), sender of the original message. */
7
7
  selective?: boolean;
8
8
  }
9
9
  export declare function constructReplyKeyboardRemove(replyMarkup_: types.ReplyKeyboardHide): ReplyKeyboardRemove;
@@ -1,4 +1,5 @@
1
1
  import * as types from "../tl/2_types.js";
2
+ /** This object represents thumbnail of a file or a sticker. */
2
3
  export interface Thumbnail {
3
4
  /** Identifier for this file, which can be used to download or reuse the file */
4
5
  fileId: string;
@@ -8,7 +9,7 @@ export interface Thumbnail {
8
9
  width: number;
9
10
  /** Photo height */
10
11
  height: number;
11
- /** Optional. File size in bytes */
12
+ /** File size in bytes */
12
13
  fileSize: number;
13
14
  }
14
15
  export declare function constructThumbnail(size: types.PhotoSize, file: types.Document | types.Photo): Thumbnail;
@@ -1,10 +1,16 @@
1
1
  import * as types from "../tl/2_types.js";
2
2
  import { Location } from "./0_location.js";
3
+ /** */
3
4
  export interface Venue {
5
+ /** Venue location. Can't be a live location */
4
6
  location: Location;
7
+ /** Name of the venue */
5
8
  title: string;
9
+ /** Address of the venue */
6
10
  address: string;
11
+ /** Foursquare identifier of the venue */
7
12
  foursquareId?: string;
13
+ /** Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */
8
14
  foursquareType?: string;
9
15
  }
10
16
  export declare function constructVenue(media_: types.MessageMediaVenue): Venue;
@@ -1,9 +1,15 @@
1
1
  import * as types from "../tl/2_types.js";
2
+ /** This object represents a voice note. */
2
3
  export interface Voice {
4
+ /** Identifier for this file, which can be used to download or reuse the file */
3
5
  fileId: string;
6
+ /** 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. */
4
7
  fileUniqueId: string;
8
+ /** Duration of the audio in seconds as defined by sender */
5
9
  duration: number;
10
+ /** MIME type of the file as defined by sender */
6
11
  mimeType: string;
12
+ /** 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. */
7
13
  fileSize: number;
8
14
  }
9
15
  export declare function constructVoice(document: types.Document, audioAttributes: types.DocumentAttributeAudio, fileId: string, fileUniqueId: string): Voice;
@@ -1,14 +1,24 @@
1
1
  import * as types from "../tl/2_types.js";
2
2
  import { Thumbnail } from "./0_thumbnail.js";
3
+ /** This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */
3
4
  export interface Animation {
5
+ /** Identifier for this file, which can be used to download or reuse the file */
4
6
  fileId: string;
7
+ /** 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. */
5
8
  fileUniqueId: string;
9
+ /** Video width as defined by sender */
6
10
  width: number;
11
+ /** Video height as defined by sender */
7
12
  height: number;
13
+ /** Duration of the video in seconds as defined by sender */
8
14
  duration: number;
15
+ /** Animation thumbnail as defined by sender */
9
16
  thumbnails: Thumbnail[];
17
+ /** Original animation filename as defined by sender */
10
18
  fileName?: string;
19
+ /** MIME type of the file as defined by sender */
11
20
  mimeType: string;
21
+ /** 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. */
12
22
  fileSize: number;
13
23
  }
14
24
  export declare function constructAnimation(document: types.Document, videoAttribute: types.DocumentAttributeVideo | undefined, fileAttribute: types.DocumentAttributeFilename | undefined, fileId: string, fileUniqueId: string): Animation;
@@ -13,22 +13,22 @@ export declare namespace Chat {
13
13
  /** Unique identifier for this chat. 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 a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
14
14
  id: number;
15
15
  idColor: string;
16
- /** Optional. Chat photo. */
16
+ /** Chat photo. */
17
17
  photo?: ChatPhoto;
18
18
  }
19
19
  interface Private extends Base {
20
20
  type: ChatType.Private;
21
21
  /** True, if this user is a bot */
22
22
  isBot?: boolean;
23
- /** Optional. First name of the other party in a private chat */
23
+ /** First name of the other party in a private chat */
24
24
  firstName: string;
25
- /** Optional. Last name of the other party in a private chat */
25
+ /** Last name of the other party in a private chat */
26
26
  lastName?: string;
27
- /** Optional. Username, for private chats, supergroups and channels if available */
27
+ /** Username, for private chats, supergroups and channels if available */
28
28
  username?: string;
29
- /** Optional. Additional usernames */
29
+ /** Additional usernames */
30
30
  also?: string[];
31
- /** Optional. Chat photo. */
31
+ /** Chat photo. */
32
32
  photo?: ChatPhoto.User;
33
33
  /** True, if the user is a scam user */
34
34
  isScam: boolean;
@@ -40,26 +40,26 @@ export declare namespace Chat {
40
40
  isVerified: boolean;
41
41
  /** True, if the access to the user must be restricted for the reason specified in `restriction_reason` */
42
42
  isRestricted?: boolean;
43
- /** Optional. Contains the reason why access to the user must be restricted. */
43
+ /** Contains the reason why access to the user must be restricted. */
44
44
  restrictionReason?: types.RestrictionReason[];
45
45
  }
46
46
  interface Group extends Base {
47
47
  type: ChatType.Group;
48
- /** Optional. Title, for supergroups, channels and group chats */
48
+ /** Title, for supergroups, channels and group chats */
49
49
  title: string;
50
- /** Optional. Chat photo. */
50
+ /** Chat photo. */
51
51
  photo?: ChatPhoto.Chat;
52
52
  /** True, if the user is creator of the chat */
53
53
  isCreator: boolean;
54
54
  }
55
55
  interface ChannelBase extends Base {
56
- /** Optional. Title, for supergroups, channels and group chats */
56
+ /** Title, for supergroups, channels and group chats */
57
57
  title: string;
58
- /** Optional. Username, for private chats, supergroups and channels if available */
58
+ /** Username, for private chats, supergroups and channels if available */
59
59
  username?: string;
60
- /** Optional. Additional usernames */
60
+ /** Additional usernames */
61
61
  also?: string[];
62
- /** Optional. Chat photo. */
62
+ /** Chat photo. */
63
63
  photo?: ChatPhoto.Chat;
64
64
  /** True, if the user is a scam user */
65
65
  isScam: boolean;
@@ -69,21 +69,21 @@ export declare namespace Chat {
69
69
  isVerified: boolean;
70
70
  /** True, if the access to the user must be restricted for the reason specified in `restriction_reason` */
71
71
  isRestricted: boolean;
72
- /** Optional. Contains the reason why access to the user must be restricted. */
72
+ /** Contains the reason why access to the user must be restricted. */
73
73
  restrictionReason?: types.RestrictionReason[];
74
74
  }
75
75
  interface Channel extends ChannelBase {
76
76
  type: ChatType.Channel;
77
- /** Optional. Title, for supergroups, channels and group chats */
77
+ /** Title, for supergroups, channels and group chats */
78
78
  title: string;
79
- /** Optional. Username, for private chats, supergroups and channels if available */
79
+ /** Username, for private chats, supergroups and channels if available */
80
80
  username?: string;
81
- /** Optional. Additional usernames */
81
+ /** Additional usernames */
82
82
  also?: string[];
83
83
  }
84
84
  interface Supergroup extends ChannelBase {
85
85
  type: ChatType.Supergroup;
86
- /** Optional. True, if the supergroup chat is a forum (has [topics](https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups) enabled) */
86
+ /** True, if the supergroup chat is a forum (has [topics](https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups) enabled) */
87
87
  isForum: boolean;
88
88
  }
89
89
  }
@@ -1,11 +1,18 @@
1
1
  import * as types from "../tl/2_types.js";
2
2
  import { Thumbnail } from "./0_thumbnail.js";
3
+ /** This object represents a general file (as opposed to [photos](https://corefork.telegram.org/bots/api#photosize), [voice messages](https://corefork.telegram.org/bots/api#voice) and [audio files](https://corefork.telegram.org/bots/api#audio)). */
3
4
  export interface Document {
5
+ /** Identifier for this file, which can be used to download or reuse the file */
4
6
  fileId: string;
7
+ /** 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. */
5
8
  fileUniqueId: string;
9
+ /** Document thumbnail as defined by sender */
6
10
  thumbnails: Thumbnail[];
11
+ /** Original filename as defined by sender */
7
12
  fileName: string;
13
+ /** MIME type of the file as defined by sender */
8
14
  mimeType: string;
15
+ /** 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. */
9
16
  fileSize: number;
10
17
  }
11
18
  export declare function constructDocument(document: types.Document, fileNameAttribute: types.DocumentAttributeFilename, fileId: string, fileUniqueId: string): Document;
@@ -8,34 +8,34 @@ export declare namespace InlineKeyboardButton {
8
8
  text: string;
9
9
  }
10
10
  interface URL extends Base {
11
- /** Optional. 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 ID without using a username, if this is allowed by their privacy settings. */
11
+ /** 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 ID without using a username, if this is allowed by their privacy settings. */
12
12
  url: string;
13
13
  }
14
14
  interface Callback extends Base {
15
- /** Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
15
+ /** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
16
16
  callbackData: string;
17
17
  }
18
18
  interface WebApp extends Base {
19
- /** Optional. Description of the [Web App](https://core.telegram.org/bots/webapps) 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. */
19
+ /** Description of the [Web App](https://core.telegram.org/bots/webapps) 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. */
20
20
  webApp: WebAppInfo;
21
21
  }
22
22
  interface Login extends Base {
23
- /** Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the [Telegram Login Widget](https://core.telegram.org/widgets/login). */
23
+ /** An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the [Telegram Login Widget](https://core.telegram.org/widgets/login). */
24
24
  loginUrl: LoginUrl;
25
25
  }
26
26
  interface SwitchInline extends Base {
27
- /** Optional. 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. */
27
+ /** 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. */
28
28
  switchInlineQuery: string;
29
29
  }
30
30
  interface SwitchInlineCurrent extends Base {
31
- /** Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. */
31
+ /** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. */
32
32
  switchInlineQueryCurrentChat: string;
33
33
  }
34
34
  interface Game extends Base {
35
35
  callbackGame: Record<never, never>;
36
36
  }
37
37
  interface Pay extends Base {
38
- /** Optional. Specify True, to send a [Pay button](https://core.telegram.org/bots/api#payments). */
38
+ /** Specify True, to send a [Pay button](https://core.telegram.org/bots/api#payments). */
39
39
  pay: boolean;
40
40
  }
41
41
  }
@@ -9,52 +9,52 @@ export declare namespace KeyboardButton {
9
9
  }
10
10
  /** This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. [More about requesting users](https://core.telegram.org/bots/features#chat-and-user-selection) */
11
11
  interface RequestUser extends Text {
12
- /** Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only. */
12
+ /** If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only. */
13
13
  requestUser: {
14
14
  /** Signed 32-bit identifier of the request, which will be received back in the [UserShared](https://core.telegram.org/bots/api#usershared) object. Must be unique within the message */
15
15
  requestId: number;
16
- /** Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. */
16
+ /** Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. */
17
17
  userIsBot?: boolean;
18
- /** Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied. */
18
+ /** Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied. */
19
19
  userIsPremium?: boolean;
20
20
  };
21
21
  }
22
22
  /** This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. [More about requesting chats](https://core.telegram.org/bots/features#chat-and-user-selection) */
23
23
  interface RequestChat extends Text {
24
- /** Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. */
24
+ /** If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. */
25
25
  requestChat: {
26
26
  /** Signed 32-bit identifier of the request, which will be received back in the [ChatShared](https://core.telegram.org/bots/api#chatshared) object. Must be unique within the message */
27
27
  requestId: number;
28
28
  /** Pass True to request a channel chat, pass False to request a group or a supergroup chat. */
29
29
  chatIsChannel: boolean;
30
- /** Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. */
30
+ /** Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. */
31
31
  chatIsForum?: boolean;
32
- /** Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied. */
32
+ /** Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied. */
33
33
  chatHasUsername?: boolean;
34
- /** Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. */
34
+ /** Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. */
35
35
  chatIsCreated?: boolean;
36
- /** Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of _bot_administrator_rights_. If not specified, no additional restrictions are applied. */
36
+ /** A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of _bot_administrator_rights_. If not specified, no additional restrictions are applied. */
37
37
  userAdministratorRights?: ChatAdministratorRights;
38
- /** Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of _user_administrator_rights_. If not specified, no additional restrictions are applied. */
38
+ /** A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of _user_administrator_rights_. If not specified, no additional restrictions are applied. */
39
39
  botAdministratorRights?: ChatAdministratorRights;
40
- /** Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
40
+ /** Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
41
41
  botIsMember?: boolean;
42
42
  };
43
43
  }
44
44
  interface RequestContact extends Text {
45
- /** Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */
45
+ /** If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */
46
46
  requestContact: true;
47
47
  }
48
48
  interface RequestLocation extends Text {
49
- /** Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only. */
49
+ /** If True, the user's current location will be sent when the button is pressed. Available in private chats only. */
50
50
  requestLocation: true;
51
51
  }
52
52
  interface RequestPoll extends Text {
53
- /** Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. */
53
+ /** If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. */
54
54
  requestPoll: KeyboardButtonPollType;
55
55
  }
56
56
  interface WebApp extends Text {
57
- /** Optional. If specified, the described [Web App](https://core.telegram.org/bots/webapps) will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. */
57
+ /** If specified, the described [Web App](https://core.telegram.org/bots/webapps) will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. */
58
58
  webApp: WebAppInfo;
59
59
  }
60
60
  }
@@ -1,5 +1,6 @@
1
1
  import * as types from "../tl/2_types.js";
2
2
  import { Thumbnail } from "./0_thumbnail.js";
3
+ /** This object represents a photo. */
3
4
  export interface Photo {
4
5
  /** Identifier for this file, which can be used to download or reuse the file */
5
6
  fileId: string;
@@ -9,7 +10,7 @@ export interface Photo {
9
10
  width: number;
10
11
  /** Photo height */
11
12
  height: number;
12
- /** Optional. File size in bytes */
13
+ /** File size in bytes */
13
14
  fileSize: number;
14
15
  thumbnails: Thumbnail[];
15
16
  }
@@ -2,21 +2,37 @@ import * as types from "../tl/2_types.js";
2
2
  import { MaybePromise } from "../utilities/0_types.js";
3
3
  import { Thumbnail } from "./0_thumbnail.js";
4
4
  import { MaskPosition } from "./0_mask_position.js";
5
+ /** This object represents a sticker. */
5
6
  export interface Sticker {
7
+ /** Identifier for this file, which can be used to download or reuse the file */
6
8
  fileId: string;
9
+ /** 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. */
7
10
  fileUniqueId: string;
11
+ /** Type of the sticker, currently one of "regular", "mask", "custom_emoji". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
8
12
  type: "regular" | "mask" | "custom_emoji";
13
+ /** Sticker width */
9
14
  width: number;
15
+ /** Sticker height */
10
16
  height: number;
17
+ /** True, if the sticker is [animated](https://telegram.org/blog/animated-stickers) */
11
18
  isAnimated: boolean;
19
+ /** True, if the sticker is a [video sticker](https://telegram.org/blog/video-stickers-better-reactions) */
12
20
  isVideo: boolean;
21
+ /** Sticker thumbnail in the .WEBP or .JPG format */
13
22
  thumbnails: Thumbnail[];
23
+ /** Emoji associated with the sticker */
14
24
  emoji?: string;
25
+ /** Name of the sticker set to which the sticker belongs */
15
26
  setName?: string;
27
+ /** For premium regular stickers, premium animation for the sticker */
16
28
  premiumAnimation?: File;
29
+ /** For mask stickers, the position where the mask should be placed */
17
30
  maskPosition?: MaskPosition;
31
+ /** For custom emoji stickers, unique identifier of the custom emoji */
18
32
  customEmojiId?: string;
33
+ /** True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places */
19
34
  needsRepainting?: boolean;
35
+ /** File size in bytes */
20
36
  fileSize?: number;
21
37
  }
22
38
  export type StickerSetNameGetter = (inputStickerSet: types.InputStickerSetID) => MaybePromise<string>;
@@ -9,27 +9,27 @@ export interface User {
9
9
  isBot: boolean;
10
10
  /** User's or bot's first name */
11
11
  firstName: string;
12
- /** Optional. User's or bot's last name */
12
+ /** User's or bot's last name */
13
13
  lastName?: string;
14
- /** Optional. User's or bot's username */
14
+ /** User's or bot's username */
15
15
  username?: string;
16
- /** Optional. Additional usernames */
16
+ /** Additional usernames */
17
17
  also?: string[];
18
- /** Optional. Chat photo */
18
+ /** Chat photo */
19
19
  photo?: ChatPhoto.User;
20
- /** Optional. [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the user's language */
20
+ /** [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the user's language */
21
21
  languageCode?: string;
22
22
  /** True, if the user is a scam user */
23
23
  isScam: boolean;
24
24
  /** True, if this user was reported by many users as a fake or scam user: be careful when interacting with them. */
25
25
  isFake: boolean;
26
- /** Optional. True, if this user is a Telegram Premium user */
26
+ /** True, if this user is a Telegram Premium user */
27
27
  isPremium: boolean;
28
28
  /** True, if the user is verified */
29
29
  isVerified: boolean;
30
30
  /** True, if the user is an official support user */
31
31
  isSupport: boolean;
32
- /** Optional. True, if this user added the bot to the attachment menu */
32
+ /** True, if this user added the bot to the attachment menu */
33
33
  addedToAttachmentMenu: boolean;
34
34
  }
35
35
  export declare function constructUser(user_: types.User): User;
@@ -1,14 +1,24 @@
1
1
  import * as types from "../tl/2_types.js";
2
2
  import { Thumbnail } from "./0_thumbnail.js";
3
+ /** This object represents a video file. */
3
4
  export interface Video {
5
+ /** Identifier for this file, which can be used to download or reuse the file */
4
6
  fileId: string;
7
+ /** 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. */
5
8
  fileUniqueId: string;
9
+ /** Video width as defined by sender */
6
10
  width: number;
11
+ /** Video height as defined by sender */
7
12
  height: number;
13
+ /** Duration of the video in seconds as defined by sender */
8
14
  duration: number;
15
+ /** Video thumbnail */
9
16
  thumbnails: Thumbnail[];
17
+ /** Original filename as defined by sender */
10
18
  fileName?: string;
19
+ /** MIME type of the file as defined by sender */
11
20
  mimeType: string;
21
+ /** 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. */
12
22
  fileSize: number;
13
23
  }
14
24
  export declare function constructVideo(document: types.Document, videoAttribute: types.DocumentAttributeVideo, fileName: string | undefined, fileId: string, fileUniqueId: string): Video;
@@ -1,12 +1,20 @@
1
1
  import * as types from "../tl/2_types.js";
2
2
  import { Thumbnail } from "./0_thumbnail.js";
3
+ /** This object represents a video message (available in Telegram apps as of v.4.0). */
3
4
  export interface VideoNote {
5
+ /** Identifier for this file, which can be used to download or reuse the file */
4
6
  fileId: string;
7
+ /** 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. */
5
8
  fileUniqueId: string;
9
+ /** Video width and height (diameter of the video message) as defined by sender */
6
10
  length: number;
11
+ /** Duration of the video in seconds as defined by sender */
7
12
  duration: number;
13
+ /** Video thumbnail */
8
14
  thumbnails: Thumbnail[];
15
+ /** Original filename as defined by sender */
9
16
  fileName?: string;
17
+ /** File size in bytes */
10
18
  fileSize: number;
11
19
  }
12
20
  export declare function constructVideoNote(document: types.Document, videoAttribute: types.DocumentAttributeVideo, fileId: string, fileUniqueId: string): VideoNote;
@@ -2,12 +2,19 @@ import * as types from "../tl/2_types.js";
2
2
  import { MessageEntity } from "./0_message_entity.js";
3
3
  import { Animation } from "./1_animation.js";
4
4
  import { Photo } from "./1_photo.js";
5
+ /** This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */
5
6
  export interface Game {
7
+ /** Title of the game */
6
8
  title: string;
9
+ /** Description of the game */
7
10
  description: string;
11
+ /** Photo that will be displayed in the game message in chats. */
8
12
  photo: Photo;
13
+ /** Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls [setGameScore](https://corefork.telegram.org/bots/api#setgamescore), or manually edited using [editMessageText](https://corefork.telegram.org/bots/api#editmessagetext). 0-4096 characters. */
9
14
  text?: string;
15
+ /** Special entities that appear in text, such as usernames, URLs, bot commands, etc. */
10
16
  textEntities?: MessageEntity[];
17
+ /** Animation that will be displayed in the game message in chats. Upload via [BotFather](https://t.me/botfather) */
11
18
  animation?: Animation;
12
19
  }
13
20
  export declare function constructGame(media_: types.MessageMediaGame): Game;
@@ -4,15 +4,15 @@ import { KeyboardButton } from "./1_keyboard_button.js";
4
4
  export interface ReplyKeyboardMarkup {
5
5
  /** Array of button rows, each represented by an Array of `KeyboardButton` objects */
6
6
  keyboard: KeyboardButton[][];
7
- /** Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. */
7
+ /** Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. */
8
8
  isPersistent?: boolean;
9
- /** Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. */
9
+ /** Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. */
10
10
  resizeKeyboard?: boolean;
11
- /** Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false. */
11
+ /** Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false. */
12
12
  oneTimeKeyboard?: boolean;
13
- /** Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
13
+ /** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
14
14
  inputFieldPlaceholder?: string;
15
- /** Optional. 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 (has reply_to_message_id), sender of the original message. */
15
+ /** 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 (has reply_to_message_id), sender of the original message. */
16
16
  selective?: boolean;
17
17
  }
18
18
  export declare function constructReplyKeyboardMarkup(keyboard_: types.ReplyKeyboardMarkup): ReplyKeyboardMarkup;