@mtkruto/node 0.1.132 → 0.1.134

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 (194) hide show
  1. package/esm/3_errors.d.ts +519 -510
  2. package/esm/3_errors.js +521 -509
  3. package/esm/3_types.d.ts +19 -7
  4. package/esm/3_types.js +19 -7
  5. package/esm/4_constants.d.ts +2 -2
  6. package/esm/4_constants.js +2 -2
  7. package/esm/4_errors.d.ts +7 -12
  8. package/esm/4_errors.js +6 -7
  9. package/esm/5_client.d.ts +3 -3
  10. package/esm/5_client.js +3 -3
  11. package/esm/client/0_utilities.d.ts +30 -2
  12. package/esm/client/0_utilities.js +13 -5
  13. package/esm/client/1_composer.d.ts +30 -0
  14. package/esm/client/{4_composer.js → 1_composer.js} +15 -2
  15. package/esm/client/2_client_plain.d.ts +1 -1
  16. package/esm/client/2_client_plain.js +1 -1
  17. package/esm/client/{3_types.d.ts → 3_params.d.ts} +68 -172
  18. package/esm/client/3_params.js +1 -0
  19. package/esm/client/{5_client.d.ts → 4_client.d.ts} +89 -57
  20. package/esm/client/{5_client.js → 4_client.js} +499 -308
  21. package/esm/client/5_composer.d.ts +4 -0
  22. package/esm/client/5_composer.js +3 -0
  23. package/esm/storage/0_storage.d.ts +4 -1
  24. package/esm/storage/0_storage.js +36 -7
  25. package/esm/storage/1_storage_indexed_db.d.ts +6 -2
  26. package/esm/storage/1_storage_indexed_db.js +7 -5
  27. package/esm/storage/1_storage_local_storage.d.ts +1 -1
  28. package/esm/storage/1_storage_local_storage.js +1 -1
  29. package/esm/storage/1_storage_memory.d.ts +1 -1
  30. package/esm/storage/1_storage_memory.js +1 -1
  31. package/esm/storage/1_storage_session_storage.d.ts +1 -1
  32. package/esm/storage/1_storage_session_storage.js +1 -1
  33. package/esm/tl/2_types.d.ts +313 -24
  34. package/esm/tl/2_types.js +982 -46
  35. package/esm/tl/3_functions.d.ts +95 -32
  36. package/esm/tl/3_functions.js +227 -66
  37. package/esm/tl/3_utilities.d.ts +1 -0
  38. package/esm/tl/3_utilities.js +14 -0
  39. package/esm/tl/6_message.js +1 -1
  40. package/esm/types/0_authorization_state.d.ts +5 -0
  41. package/esm/types/0_authorization_state.js +1 -0
  42. package/esm/types/0_chat_photo.d.ts +22 -21
  43. package/esm/types/0_connection_state.d.ts +17 -0
  44. package/esm/types/0_connection_state.js +1 -0
  45. package/esm/types/0_giveaway_parameters.d.ts +9 -0
  46. package/esm/types/0_giveaway_parameters.js +9 -0
  47. package/esm/types/0_login_url.d.ts +0 -4
  48. package/esm/types/0_mask_position.d.ts +0 -4
  49. package/esm/types/0_message_entity.d.ts +91 -74
  50. package/esm/types/0_message_identifier.d.ts +4 -0
  51. package/esm/types/0_message_identifier.js +1 -0
  52. package/esm/types/0_network_statistics_entry.d.ts +4 -0
  53. package/esm/types/0_network_statistics_entry.js +1 -0
  54. package/esm/types/0_reaction.d.ts +14 -10
  55. package/esm/types/0_reaction.js +29 -1
  56. package/esm/types/1__getters.d.ts +3 -0
  57. package/esm/types/1_bot_command_scope.d.ts +32 -27
  58. package/esm/types/1_chat_p.d.ts +77 -68
  59. package/esm/types/1_giveaway.d.ts +8 -0
  60. package/esm/types/1_giveaway.js +7 -0
  61. package/esm/types/1_keyboard_button.d.ts +41 -57
  62. package/esm/types/1_keyboard_button.js +3 -0
  63. package/esm/types/1_message_reaction.d.ts +14 -0
  64. package/esm/types/1_message_reaction.js +22 -0
  65. package/esm/types/1_network_statistics.d.ts +5 -0
  66. package/esm/types/1_network_statistics.js +1 -0
  67. package/esm/types/1_poll.d.ts +0 -13
  68. package/esm/types/1_reaction_count.d.ts +7 -0
  69. package/esm/types/1_reaction_count.js +6 -0
  70. package/esm/types/1_user.d.ts +2 -2
  71. package/esm/types/2_game.d.ts +0 -7
  72. package/esm/types/2_inline_keyboard_button.d.ts +36 -37
  73. package/esm/types/2_inline_query.d.ts +0 -6
  74. package/esm/types/2_message_interactions.d.ts +8 -0
  75. package/esm/types/2_message_interactions.js +1 -0
  76. package/esm/types/2_message_reaction_count.d.ts +8 -0
  77. package/esm/types/2_message_reaction_count.js +1 -0
  78. package/esm/types/2_reply_keyboard_markup.d.ts +0 -7
  79. package/esm/types/3_inline_keyboard_markup.d.ts +0 -2
  80. package/esm/types/4_message.d.ts +457 -0
  81. package/esm/types/{3_message.js → 4_message.js} +216 -129
  82. package/{script/types/4_callback_query.d.ts → esm/types/5_callback_query.d.ts} +1 -1
  83. package/esm/types/5_chat.d.ts +37 -0
  84. package/esm/types/{4_chat.js → 5_chat.js} +2 -2
  85. package/esm/types/6_update.d.ts +134 -0
  86. package/esm/types/6_update.js +1 -0
  87. package/package.json +1 -1
  88. package/script/3_errors.d.ts +519 -510
  89. package/script/3_errors.js +533 -520
  90. package/script/3_types.d.ts +19 -7
  91. package/script/3_types.js +19 -7
  92. package/script/4_constants.d.ts +2 -2
  93. package/script/4_constants.js +2 -2
  94. package/script/4_errors.d.ts +7 -12
  95. package/script/4_errors.js +5 -6
  96. package/script/5_client.d.ts +3 -3
  97. package/script/5_client.js +3 -3
  98. package/script/client/0_utilities.d.ts +30 -2
  99. package/script/client/0_utilities.js +15 -6
  100. package/script/client/1_composer.d.ts +30 -0
  101. package/script/client/{4_composer.js → 1_composer.js} +17 -4
  102. package/script/client/2_client_plain.d.ts +1 -1
  103. package/script/client/2_client_plain.js +2 -2
  104. package/script/client/{3_types.d.ts → 3_params.d.ts} +68 -172
  105. package/script/client/3_params.js +2 -0
  106. package/script/client/{5_client.d.ts → 4_client.d.ts} +89 -57
  107. package/script/client/{5_client.js → 4_client.js} +505 -314
  108. package/script/client/5_composer.d.ts +4 -0
  109. package/script/client/{6_composer.js → 5_composer.js} +2 -2
  110. package/script/storage/0_storage.d.ts +4 -1
  111. package/script/storage/0_storage.js +36 -7
  112. package/script/storage/1_storage_indexed_db.d.ts +6 -2
  113. package/script/storage/1_storage_indexed_db.js +7 -5
  114. package/script/storage/1_storage_local_storage.d.ts +1 -1
  115. package/script/storage/1_storage_local_storage.js +1 -1
  116. package/script/storage/1_storage_memory.d.ts +1 -1
  117. package/script/storage/1_storage_memory.js +1 -1
  118. package/script/storage/1_storage_session_storage.d.ts +1 -1
  119. package/script/storage/1_storage_session_storage.js +1 -1
  120. package/script/tl/2_types.d.ts +313 -24
  121. package/script/tl/2_types.js +1169 -217
  122. package/script/tl/3_functions.d.ts +95 -32
  123. package/script/tl/3_functions.js +241 -77
  124. package/script/tl/3_utilities.d.ts +1 -0
  125. package/script/tl/3_utilities.js +16 -1
  126. package/script/tl/6_message.js +1 -1
  127. package/script/types/0_authorization_state.d.ts +5 -0
  128. package/script/types/0_authorization_state.js +2 -0
  129. package/script/types/0_chat_photo.d.ts +22 -21
  130. package/script/types/0_connection_state.d.ts +17 -0
  131. package/script/types/0_connection_state.js +2 -0
  132. package/script/types/0_giveaway_parameters.d.ts +9 -0
  133. package/script/types/0_giveaway_parameters.js +13 -0
  134. package/script/types/0_login_url.d.ts +0 -4
  135. package/script/types/0_mask_position.d.ts +0 -4
  136. package/script/types/0_message_entity.d.ts +91 -74
  137. package/script/types/0_message_identifier.d.ts +4 -0
  138. package/script/types/0_message_identifier.js +2 -0
  139. package/script/types/0_network_statistics_entry.d.ts +4 -0
  140. package/script/types/0_network_statistics_entry.js +2 -0
  141. package/script/types/0_reaction.d.ts +14 -10
  142. package/script/types/0_reaction.js +33 -0
  143. package/script/types/1__getters.d.ts +3 -0
  144. package/script/types/1_bot_command_scope.d.ts +32 -27
  145. package/script/types/1_chat_p.d.ts +77 -68
  146. package/script/types/1_giveaway.d.ts +8 -0
  147. package/script/types/1_giveaway.js +11 -0
  148. package/script/types/1_keyboard_button.d.ts +41 -57
  149. package/script/types/1_keyboard_button.js +3 -0
  150. package/script/types/1_message_reaction.d.ts +14 -0
  151. package/script/types/1_message_reaction.js +26 -0
  152. package/script/types/1_network_statistics.d.ts +5 -0
  153. package/script/types/1_network_statistics.js +2 -0
  154. package/script/types/1_poll.d.ts +0 -13
  155. package/script/types/1_reaction_count.d.ts +7 -0
  156. package/script/types/1_reaction_count.js +10 -0
  157. package/script/types/1_user.d.ts +2 -2
  158. package/script/types/2_game.d.ts +0 -7
  159. package/script/types/2_inline_keyboard_button.d.ts +36 -37
  160. package/script/types/2_inline_query.d.ts +0 -6
  161. package/script/types/2_message_interactions.d.ts +8 -0
  162. package/script/types/2_message_interactions.js +2 -0
  163. package/script/types/2_message_reaction_count.d.ts +8 -0
  164. package/script/types/2_message_reaction_count.js +2 -0
  165. package/script/types/2_reply_keyboard_markup.d.ts +0 -7
  166. package/script/types/3_inline_keyboard_markup.d.ts +0 -2
  167. package/script/types/4_message.d.ts +457 -0
  168. package/script/types/{3_message.js → 4_message.js} +218 -130
  169. package/{esm/types/4_callback_query.d.ts → script/types/5_callback_query.d.ts} +1 -1
  170. package/script/types/5_chat.d.ts +37 -0
  171. package/script/types/{4_chat.js → 5_chat.js} +3 -3
  172. package/script/types/6_update.d.ts +134 -0
  173. package/script/types/6_update.js +2 -0
  174. package/esm/client/3_types.js +0 -11
  175. package/esm/client/4_composer.d.ts +0 -31
  176. package/esm/client/6_composer.d.ts +0 -4
  177. package/esm/client/6_composer.js +0 -3
  178. package/esm/types/3_message.d.ts +0 -182
  179. package/esm/types/4_chat.d.ts +0 -34
  180. package/script/client/3_types.js +0 -15
  181. package/script/client/4_composer.d.ts +0 -31
  182. package/script/client/6_composer.d.ts +0 -4
  183. package/script/types/3_message.d.ts +0 -182
  184. package/script/types/4_chat.d.ts +0 -34
  185. /package/esm/client/{1_client_abstract.d.ts → 0_client_abstract.d.ts} +0 -0
  186. /package/esm/client/{1_client_abstract.js → 0_client_abstract.js} +0 -0
  187. /package/esm/types/{0_audio.d.ts → 1_audio.d.ts} +0 -0
  188. /package/esm/types/{0_audio.js → 1_audio.js} +0 -0
  189. /package/esm/types/{4_callback_query.js → 5_callback_query.js} +0 -0
  190. /package/script/client/{1_client_abstract.d.ts → 0_client_abstract.d.ts} +0 -0
  191. /package/script/client/{1_client_abstract.js → 0_client_abstract.js} +0 -0
  192. /package/script/types/{0_audio.d.ts → 1_audio.d.ts} +0 -0
  193. /package/script/types/{0_audio.js → 1_audio.js} +0 -0
  194. /package/script/types/{4_callback_query.js → 5_callback_query.js} +0 -0
@@ -2,63 +2,47 @@ import { enums } from "../2_tl.js";
2
2
  import { ChatAdministratorRights } from "./0_chat_administrator_rights.js";
3
3
  import { KeyboardButtonPollType } from "./0_keyboard_button_poll_type.js";
4
4
  import { WebAppInfo } from "./0_web_app_info.js";
5
- export declare namespace KeyboardButton {
6
- interface Text {
7
- /** The button's text. */
8
- text: string;
9
- }
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. */
11
- interface RequestUser extends Text {
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
- requestUser: {
14
- /** Signed 32-bit identifier of the request */
15
- requestId: number;
16
- /** Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. */
17
- userIsBot?: boolean;
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
- userIsPremium?: boolean;
20
- };
21
- }
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. */
23
- interface RequestChat extends Text {
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
- requestChat: {
26
- /** Signed 32-bit identifier of the request */
27
- requestId: number;
28
- /** Pass True to request a channel chat, pass False to request a group or a supergroup chat. */
29
- chatIsChannel: boolean;
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
- chatIsForum?: boolean;
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
- chatHasUsername?: boolean;
34
- /** Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. */
35
- chatIsCreated?: boolean;
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
- userAdministratorRights?: ChatAdministratorRights;
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
- botAdministratorRights?: ChatAdministratorRights;
40
- /** Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
41
- botIsMember?: boolean;
42
- };
43
- }
44
- interface RequestContact extends Text {
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
- requestContact: true;
47
- }
48
- interface RequestLocation extends Text {
49
- /** If True, the user's current location will be sent when the button is pressed. Available in private chats only. */
50
- requestLocation: true;
51
- }
52
- interface RequestPoll extends Text {
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
- requestPoll: KeyboardButtonPollType;
55
- }
56
- interface WebApp extends Text {
57
- /** If specified, the described Web App 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
- webApp: WebAppInfo;
59
- }
5
+ /** @unlisted */
6
+ export interface KeyboardButtonText {
7
+ text: string;
60
8
  }
61
- /** 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_user_, _request_chat_, _request_contact_, _request_location_, and _request_poll_ are mutually exclusive. */
62
- export type KeyboardButton = KeyboardButton.Text | KeyboardButton.RequestUser | KeyboardButton.RequestChat | KeyboardButton.RequestContact | KeyboardButton.RequestLocation | KeyboardButton.RequestPoll | KeyboardButton.WebApp;
9
+ /** @unlisted */
10
+ export interface KeyboardButtonRequestUser extends KeyboardButtonText {
11
+ requestUser: {
12
+ requestId: number;
13
+ userIsBot?: boolean;
14
+ userIsPremium?: boolean;
15
+ };
16
+ }
17
+ /** @unlisted */
18
+ export interface KeyboardButtonRequestChat extends KeyboardButtonText {
19
+ requestChat: {
20
+ requestId: number;
21
+ chatIsChannel: boolean;
22
+ chatIsForum?: boolean;
23
+ chatHasUsername?: boolean;
24
+ chatIsCreated?: boolean;
25
+ userAdministratorRights?: ChatAdministratorRights;
26
+ botAdministratorRights?: ChatAdministratorRights;
27
+ botIsMember?: boolean;
28
+ };
29
+ }
30
+ /** @unlisted */
31
+ export interface KeyboardButtonRequestContact extends KeyboardButtonText {
32
+ requestContact: true;
33
+ }
34
+ /** @unlisted */
35
+ export interface KeyboardButtonRequestLocation extends KeyboardButtonText {
36
+ requestLocation: true;
37
+ }
38
+ /** @unlisted */
39
+ export interface KeyboardButtonRequestPoll extends KeyboardButtonText {
40
+ requestPoll: KeyboardButtonPollType;
41
+ }
42
+ /** @unlisted */
43
+ export interface KeyboardButtonWebApp extends KeyboardButtonText {
44
+ webApp: WebAppInfo;
45
+ }
46
+ export type KeyboardButton = KeyboardButtonText | KeyboardButtonRequestUser | KeyboardButtonRequestChat | KeyboardButtonRequestContact | KeyboardButtonRequestLocation | KeyboardButtonRequestPoll | KeyboardButtonWebApp;
63
47
  export declare function constructKeyboardButton(button_: enums.KeyboardButton): KeyboardButton;
64
48
  export declare function keyboardButtonToTlObject(button: KeyboardButton): import("../tl/2_types.js").KeyboardButton_ | import("../tl/2_types.js").KeyboardButtonRequestPhone_ | import("../tl/2_types.js").KeyboardButtonRequestGeoLocation_ | import("../tl/2_types.js").KeyboardButtonRequestPoll_ | import("../tl/2_types.js").KeyboardButtonWebView_ | import("../tl/2_types.js").KeyboardButtonRequestPeer_;
@@ -88,6 +88,7 @@ function keyboardButtonToTlObject(button) {
88
88
  text: button.text,
89
89
  button_id: button.requestUser.requestId,
90
90
  peer_type: new _2_tl_js_1.types.RequestPeerTypeUser({ bot: button.requestUser.userIsBot, premium: button.requestUser.userIsPremium }),
91
+ max_quantity: 1,
91
92
  });
92
93
  }
93
94
  else if ("requestChat" in button) {
@@ -103,6 +104,7 @@ function keyboardButtonToTlObject(button) {
103
104
  bot_admin_rights: button.requestChat.botAdministratorRights ? (0, _0_chat_administrator_rights_js_1.chatAdministratorRightsToTlObject)(button.requestChat.botAdministratorRights) : undefined,
104
105
  user_admin_rights: button.requestChat.userAdministratorRights ? (0, _0_chat_administrator_rights_js_1.chatAdministratorRightsToTlObject)(button.requestChat.userAdministratorRights) : undefined,
105
106
  }),
107
+ max_quantity: 1,
106
108
  });
107
109
  }
108
110
  else {
@@ -115,6 +117,7 @@ function keyboardButtonToTlObject(button) {
115
117
  bot_admin_rights: button.requestChat.botAdministratorRights ? (0, _0_chat_administrator_rights_js_1.chatAdministratorRightsToTlObject)(button.requestChat.botAdministratorRights) : undefined,
116
118
  user_admin_rights: button.requestChat.userAdministratorRights ? (0, _0_chat_administrator_rights_js_1.chatAdministratorRightsToTlObject)(button.requestChat.userAdministratorRights) : undefined,
117
119
  }),
120
+ max_quantity: 1,
118
121
  });
119
122
  }
120
123
  }
@@ -0,0 +1,14 @@
1
+ import { types } from "../2_tl.js";
2
+ import { Reaction } from "./0_reaction.js";
3
+ /** Represents a type of reaction made to a message. */
4
+ export interface MessageReaction {
5
+ /** The type of the reaction. */
6
+ reaction: Reaction;
7
+ /** The number of those who made this reaction. */
8
+ count: number;
9
+ /** A list of identifiers of users who recently made this reaction. */
10
+ choosers: number[];
11
+ /** Whether the current user made this reaction. */
12
+ chosen: boolean;
13
+ }
14
+ export declare function constructMessageReaction(reaction_: types.ReactionCount, recentReactions: types.MessagePeerReaction[]): MessageReaction;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.constructMessageReaction = void 0;
4
+ const _1_utilities_js_1 = require("../1_utilities.js");
5
+ const _2_tl_js_1 = require("../2_tl.js");
6
+ const _0_reaction_js_1 = require("./0_reaction.js");
7
+ function constructMessageReaction(reaction_, recentReactions) {
8
+ const choosers = recentReactions
9
+ .filter((v) => {
10
+ if (reaction_.reaction instanceof _2_tl_js_1.types.ReactionEmoji) {
11
+ return v.reaction instanceof _2_tl_js_1.types.ReactionEmoji && v.reaction.emoticon == reaction_.reaction.emoticon;
12
+ }
13
+ else if (reaction_.reaction instanceof _2_tl_js_1.types.ReactionCustomEmoji) {
14
+ return v.reaction instanceof _2_tl_js_1.types.ReactionCustomEmoji && v.reaction.document_id == reaction_.reaction.document_id;
15
+ }
16
+ else {
17
+ (0, _1_utilities_js_1.UNREACHABLE)();
18
+ }
19
+ })
20
+ .map((v) => (0, _2_tl_js_1.peerToChatId)(v.peer_id));
21
+ const reaction = (0, _0_reaction_js_1.constructReaction)(reaction_.reaction);
22
+ const count = reaction_.count;
23
+ const chosen = reaction_.chosen_order !== undefined ? true : false;
24
+ return { reaction, count, choosers, chosen };
25
+ }
26
+ exports.constructMessageReaction = constructMessageReaction;
@@ -0,0 +1,5 @@
1
+ import { NetworkStatisticsEntry } from "./0_network_statistics_entry.js";
2
+ export interface NetworkStatistics {
3
+ messages: NetworkStatisticsEntry;
4
+ cdn: NetworkStatisticsEntry;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,31 +2,18 @@ import { types } from "../2_tl.js";
2
2
  import { MessageEntity } from "./0_message_entity.js";
3
3
  import { PollOption } from "./0_poll_option.js";
4
4
  export interface Poll {
5
- /** Unique poll identifier */
6
5
  id: string;
7
- /** Poll question, 1-300 characters */
8
6
  question: string;
9
- /** List of poll options */
10
7
  options: PollOption[];
11
- /** Total number of users that voted in the poll */
12
8
  totalVoterCount: number;
13
- /** True, if the poll is closed */
14
9
  isClosed: boolean;
15
- /** True, if the poll is anonymous */
16
10
  isAnonymous: boolean;
17
- /** Poll type, currently can be "regular" or "quiz" */
18
11
  type: "regular" | "quiz";
19
- /** True, if the poll allows multiple answers */
20
12
  allowMultipleAnswers?: boolean;
21
- /** Index of the correct answer in `options`. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */
22
13
  correctOptionIndex?: number;
23
- /** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */
24
14
  explanation?: string;
25
- /** Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */
26
15
  explanationEntities?: MessageEntity[];
27
- /** Amount of time in seconds the poll will be active after creation */
28
16
  openPeriod?: number;
29
- /** Point in time (Unix timestamp) when the poll will be automatically closed */
30
17
  closeDate?: Date;
31
18
  }
32
19
  export declare function constructPoll(media_: types.MessageMediaPoll): Poll;
@@ -0,0 +1,7 @@
1
+ import { types } from "../2_tl.js";
2
+ import { Reaction } from "./0_reaction.js";
3
+ export interface ReactionCount {
4
+ reaction: Reaction;
5
+ count: number;
6
+ }
7
+ export declare function constructReactionCount(reaction_: types.ReactionCount): ReactionCount;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.constructReactionCount = void 0;
4
+ const _0_reaction_js_1 = require("./0_reaction.js");
5
+ function constructReactionCount(reaction_) {
6
+ const reaction = (0, _0_reaction_js_1.constructReaction)(reaction_.reaction);
7
+ const count = reaction_.count;
8
+ return { reaction, count };
9
+ }
10
+ exports.constructReactionCount = constructReactionCount;
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { ChatPhoto } from "./0_chat_photo.js";
2
+ import { ChatPhotoUser } from "./0_chat_photo.js";
3
3
  /** This object represents a Telegram user or bot. */
4
4
  export interface User {
5
5
  /** Unique identifier for this user or bot */
@@ -17,7 +17,7 @@ export interface User {
17
17
  /** Additional usernames */
18
18
  also?: string[];
19
19
  /** The user's photo. */
20
- photo?: ChatPhoto.User;
20
+ photo?: ChatPhotoUser;
21
21
  /** [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the user's language */
22
22
  languageCode?: string;
23
23
  /** True, if the user is a scam user */
@@ -2,19 +2,12 @@ import { types } from "../2_tl.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. */
6
5
  export interface Game {
7
- /** Title of the game */
8
6
  title: string;
9
- /** Description of the game */
10
7
  description: string;
11
- /** Photo that will be displayed in the game message in chats. */
12
8
  photo: Photo;
13
- /** Brief description of the game or high scores included in the game message */
14
9
  text?: string;
15
- /** Special entities that appear in text, such as usernames, URLs, bot commands, etc. */
16
10
  textEntities?: MessageEntity[];
17
- /** Animation that will be displayed in the game message in chats */
18
11
  animation?: Animation;
19
12
  }
20
13
  export declare function constructGame(media_: types.MessageMediaGame): Game;
@@ -2,44 +2,43 @@ import { enums } from "../2_tl.js";
2
2
  import { LoginUrl } from "./0_login_url.js";
3
3
  import { WebAppInfo } from "./0_web_app_info.js";
4
4
  import { UsernameResolver } from "./1__getters.js";
5
- export declare namespace InlineKeyboardButton {
6
- interface Base {
7
- /** Label text on the button */
8
- text: string;
9
- }
10
- interface URL extends Base {
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
- url: string;
13
- }
14
- interface Callback extends Base {
15
- /** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
16
- callbackData: string;
17
- }
18
- interface WebApp extends Base {
19
- /** 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. */
20
- webApp: WebAppInfo;
21
- }
22
- interface Login extends Base {
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
- loginUrl: LoginUrl;
25
- }
26
- interface SwitchInline extends Base {
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
- switchInlineQuery: string;
29
- }
30
- interface SwitchInlineCurrent extends Base {
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
- switchInlineQueryCurrentChat: string;
33
- }
34
- interface Game extends Base {
35
- callbackGame: Record<never, never>;
36
- }
37
- interface Pay extends Base {
38
- /** Specify True to send a Pay button */
39
- pay: boolean;
40
- }
5
+ /** @unlisted */
6
+ export interface InlineKeyboardButtonBase {
7
+ text: string;
8
+ }
9
+ /** @unlisted */
10
+ export interface InlineKeyboardButtonURL extends InlineKeyboardButtonBase {
11
+ url: string;
12
+ }
13
+ /** @unlisted */
14
+ export interface InlineKeyboardButtonCallback extends InlineKeyboardButtonBase {
15
+ callbackData: string;
16
+ }
17
+ /** @unlisted */
18
+ export interface InlineKeyboardButtonWebApp extends InlineKeyboardButtonBase {
19
+ webApp: WebAppInfo;
20
+ }
21
+ /** @unlisted */
22
+ export interface InlineKeyboardButtonLogin extends InlineKeyboardButtonBase {
23
+ loginUrl: LoginUrl;
24
+ }
25
+ /** @unlisted */
26
+ export interface InlineKeyboardButtonSwitchInline extends InlineKeyboardButtonBase {
27
+ switchInlineQuery: string;
28
+ }
29
+ /** @unlisted */
30
+ export interface InlineKeyboardButtonSwitchInlineCurrent extends InlineKeyboardButtonBase {
31
+ switchInlineQueryCurrentChat: string;
32
+ }
33
+ /** @unlisted */
34
+ export interface InlineKeyboardButtonGame extends InlineKeyboardButtonBase {
35
+ callbackGame: Record<never, never>;
36
+ }
37
+ /** @unlisted */
38
+ export interface InlineKeyboardButtonPay extends InlineKeyboardButtonBase {
39
+ pay: boolean;
41
40
  }
42
41
  /** This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. */
43
- export type InlineKeyboardButton = InlineKeyboardButton.URL | InlineKeyboardButton.Callback | InlineKeyboardButton.WebApp | InlineKeyboardButton.Login | InlineKeyboardButton.SwitchInline | InlineKeyboardButton.SwitchInlineCurrent | InlineKeyboardButton.Game | InlineKeyboardButton.Pay;
42
+ export type InlineKeyboardButton = InlineKeyboardButtonURL | InlineKeyboardButtonCallback | InlineKeyboardButtonWebApp | InlineKeyboardButtonLogin | InlineKeyboardButtonSwitchInline | InlineKeyboardButtonSwitchInlineCurrent | InlineKeyboardButtonGame | InlineKeyboardButtonPay;
44
43
  export declare function constructInlineKeyboardButton(button_: enums.KeyboardButton): InlineKeyboardButton;
45
44
  export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: UsernameResolver): Promise<import("../tl/2_types.js").KeyboardButtonUrl_ | import("../tl/2_types.js").KeyboardButtonCallback_ | import("../tl/2_types.js").KeyboardButtonSwitchInline_ | import("../tl/2_types.js").KeyboardButtonBuy_ | import("../tl/2_types.js").InputKeyboardButtonUrlAuth_ | import("../tl/2_types.js").KeyboardButtonWebView_>;
@@ -3,17 +3,11 @@ import { Location } from "./0_location.js";
3
3
  import { EntityGetter } from "./1__getters.js";
4
4
  import { User } from "./1_user.js";
5
5
  export interface InlineQuery {
6
- /** Unique identifier for this query */
7
6
  id: string;
8
- /** The user who made this query */
9
7
  from: User;
10
- /** The text of the query */
11
8
  query: string;
12
- /** Result offset */
13
9
  offset: string;
14
- /** Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */
15
10
  chatType?: "sender" | "private" | "group" | "supergroup" | "channel";
16
- /** The location of the user who made this query */
17
11
  location?: Location;
18
12
  }
19
13
  export declare function constructInlineQuery(query_: types.UpdateBotInlineQuery, getEntity: EntityGetter): Promise<InlineQuery>;
@@ -0,0 +1,8 @@
1
+ import { MessageReaction } from "./1_message_reaction.js";
2
+ export interface MessageInteractions {
3
+ chatId: number;
4
+ messageId: number;
5
+ reactions: MessageReaction[];
6
+ views: number;
7
+ forwards: number;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import { ChatP } from "./1_chat_p.js";
2
+ import { ReactionCount } from "./1_reaction_count.js";
3
+ export interface MessageReactionCount {
4
+ chat: ChatP;
5
+ messageId: number;
6
+ date: Date;
7
+ reactions: ReactionCount[];
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +1,11 @@
1
1
  import { types } from "../2_tl.js";
2
2
  import { KeyboardButton } from "./1_keyboard_button.js";
3
- /** This object represents a custom keyboard with reply options. */
4
3
  export interface ReplyKeyboardMarkup {
5
- /** Array of button rows, each represented by an Array of `KeyboardButton` objects */
6
4
  keyboard: KeyboardButton[][];
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
5
  isPersistent?: boolean;
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
6
  resizeKeyboard?: boolean;
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
7
  oneTimeKeyboard?: boolean;
13
- /** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
14
8
  inputFieldPlaceholder?: string;
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
9
  selective?: boolean;
17
10
  }
18
11
  export declare function constructReplyKeyboardMarkup(keyboard_: types.ReplyKeyboardMarkup): ReplyKeyboardMarkup;
@@ -1,9 +1,7 @@
1
1
  import { types } from "../2_tl.js";
2
2
  import { UsernameResolver } from "./1__getters.js";
3
3
  import { InlineKeyboardButton } from "./2_inline_keyboard_button.js";
4
- /** This object represents an inline keyboard that appears right next to the message it belongs to. */
5
4
  export interface InlineKeyboardMarkup {
6
- /** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
7
5
  inlineKeyboard: InlineKeyboardButton[][];
8
6
  }
9
7
  export declare function constructInlineKeyboardMarkup(keyboard_: types.ReplyInlineMarkup): InlineKeyboardMarkup;