@mtkruto/node 0.1.190 → 0.1.200

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 (205) hide show
  1. package/esm/0_errors.d.ts +12 -0
  2. package/esm/0_errors.js +19 -0
  3. package/esm/1_utilities.d.ts +1 -1
  4. package/esm/1_utilities.js +1 -1
  5. package/esm/2_tl.d.ts +6 -6
  6. package/esm/2_tl.js +6 -6
  7. package/esm/3_storage.d.ts +5 -5
  8. package/esm/3_storage.js +5 -5
  9. package/esm/3_types.d.ts +6 -5
  10. package/esm/3_types.js +6 -5
  11. package/esm/4_constants.d.ts +2 -2
  12. package/esm/4_constants.js +2 -2
  13. package/esm/5_client.d.ts +1 -1
  14. package/esm/5_client.js +1 -1
  15. package/esm/client/0_client_abstract.js +3 -2
  16. package/esm/client/0_html.js +4 -3
  17. package/esm/client/0_markdown.js +6 -5
  18. package/esm/client/0_params.d.ts +7 -1
  19. package/esm/client/0_types.d.ts +1 -2
  20. package/esm/client/0_types.js +1 -2
  21. package/esm/client/0_utilities.d.ts +0 -3
  22. package/esm/client/0_utilities.js +2 -21
  23. package/esm/client/1_business_connection_manager.d.ts +11 -0
  24. package/esm/client/1_business_connection_manager.js +47 -0
  25. package/esm/client/1_client_encrypted.js +1 -1
  26. package/esm/client/1_client_plain.js +3 -4
  27. package/esm/client/1_composer.js +3 -2
  28. package/esm/client/1_file_manager.js +4 -4
  29. package/esm/client/1_update_manager.d.ts +8 -1
  30. package/esm/client/1_update_manager.js +88 -8
  31. package/esm/client/2_message_manager.d.ts +7 -6
  32. package/esm/client/2_message_manager.js +89 -74
  33. package/esm/client/3_chat_list_manager.js +3 -2
  34. package/esm/client/3_story_manager.js +2 -1
  35. package/esm/client/4_client.d.ts +422 -421
  36. package/esm/client/4_client.js +578 -520
  37. package/esm/mod.d.ts +1 -0
  38. package/esm/mod.js +1 -0
  39. package/esm/storage/0_storage.d.ts +5 -0
  40. package/esm/storage/0_storage.js +20 -0
  41. package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
  42. package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
  43. package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
  44. package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
  45. package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
  46. package/esm/tl/2_types.d.ts +1071 -183
  47. package/esm/tl/2_types.js +2916 -464
  48. package/esm/tl/3_functions.d.ts +381 -17
  49. package/esm/tl/3_functions.js +1002 -120
  50. package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
  51. package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
  52. package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
  53. package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
  54. package/esm/tl/{6_message.js → 7_message.js} +3 -3
  55. package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
  56. package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
  57. package/esm/types/0_chat_photo.d.ts +1 -0
  58. package/esm/types/0_chat_photo.js +8 -5
  59. package/esm/types/0_message_entity.d.ts +1 -1
  60. package/esm/types/0_thumbnail.js +1 -1
  61. package/esm/types/1_bot_command_scope.d.ts +1 -1
  62. package/esm/types/1_photo.js +2 -2
  63. package/esm/types/1_story_privacy.d.ts +1 -1
  64. package/esm/types/2_business_connection.d.ts +11 -0
  65. package/esm/types/2_business_connection.js +12 -0
  66. package/esm/types/2_chat_member.d.ts +1 -1
  67. package/esm/types/2_chosen_inline_result.d.ts +1 -1
  68. package/esm/types/2_game.js +1 -1
  69. package/esm/types/2_inline_keyboard_button.d.ts +1 -1
  70. package/esm/types/2_inline_query.d.ts +1 -1
  71. package/esm/types/2_invite_link.d.ts +1 -1
  72. package/esm/types/2_message_reaction_count.d.ts +1 -1
  73. package/esm/types/2_message_reactions.d.ts +1 -1
  74. package/esm/types/2_story_content.js +1 -1
  75. package/{script/types/1_story_interactive_area.d.ts → esm/types/2_story_interactive_area.d.ts} +2 -2
  76. package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
  77. package/esm/types/3_chat_member_updated.d.ts +1 -1
  78. package/esm/types/3_reply_markup.d.ts +1 -1
  79. package/esm/types/3_story.d.ts +2 -2
  80. package/esm/types/3_story.js +1 -1
  81. package/esm/types/4_inline_query_result.d.ts +1 -1
  82. package/esm/types/4_inline_query_result.js +1 -1
  83. package/esm/types/4_message.d.ts +9 -3
  84. package/esm/types/4_message.js +22 -5
  85. package/esm/types/5_callback_query.d.ts +1 -1
  86. package/esm/types/5_callback_query.js +2 -1
  87. package/esm/types/5_chat.d.ts +1 -1
  88. package/esm/types/6_update.d.ts +12 -2
  89. package/esm/types/{0__file_id.js → _file_id.js} +2 -1
  90. package/package.json +1 -1
  91. package/script/0_errors.d.ts +12 -0
  92. package/script/0_errors.js +27 -0
  93. package/script/1_utilities.d.ts +1 -1
  94. package/script/1_utilities.js +1 -1
  95. package/script/2_tl.d.ts +6 -6
  96. package/script/2_tl.js +6 -6
  97. package/script/3_storage.d.ts +5 -5
  98. package/script/3_storage.js +5 -5
  99. package/script/3_types.d.ts +6 -5
  100. package/script/3_types.js +6 -5
  101. package/script/4_constants.d.ts +2 -2
  102. package/script/4_constants.js +2 -2
  103. package/script/5_client.d.ts +1 -1
  104. package/script/5_client.js +1 -1
  105. package/script/client/0_client_abstract.js +3 -2
  106. package/script/client/0_html.js +4 -3
  107. package/script/client/0_markdown.js +6 -5
  108. package/script/client/0_params.d.ts +7 -1
  109. package/script/client/0_types.d.ts +1 -2
  110. package/script/client/0_types.js +0 -4
  111. package/script/client/0_utilities.d.ts +0 -3
  112. package/script/client/0_utilities.js +3 -24
  113. package/script/client/1_business_connection_manager.d.ts +11 -0
  114. package/script/client/1_business_connection_manager.js +51 -0
  115. package/script/client/1_client_encrypted.js +2 -2
  116. package/script/client/1_client_plain.js +3 -4
  117. package/script/client/1_composer.js +3 -2
  118. package/script/client/1_file_manager.js +5 -5
  119. package/script/client/1_update_manager.d.ts +8 -1
  120. package/script/client/1_update_manager.js +88 -8
  121. package/script/client/2_message_manager.d.ts +7 -6
  122. package/script/client/2_message_manager.js +88 -73
  123. package/script/client/3_chat_list_manager.js +3 -2
  124. package/script/client/3_story_manager.js +2 -1
  125. package/script/client/4_client.d.ts +422 -421
  126. package/script/client/4_client.js +578 -520
  127. package/script/mod.d.ts +1 -0
  128. package/script/mod.js +1 -0
  129. package/script/storage/0_storage.d.ts +5 -0
  130. package/script/storage/0_storage.js +20 -0
  131. package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
  132. package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
  133. package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
  134. package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
  135. package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
  136. package/script/tl/2_types.d.ts +1071 -183
  137. package/script/tl/2_types.js +3028 -504
  138. package/script/tl/3_functions.d.ts +381 -17
  139. package/script/tl/3_functions.js +1047 -143
  140. package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
  141. package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
  142. package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
  143. package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
  144. package/script/tl/{6_message.js → 7_message.js} +8 -8
  145. package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
  146. package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
  147. package/script/types/0_chat_photo.d.ts +1 -0
  148. package/script/types/0_chat_photo.js +16 -13
  149. package/script/types/0_message_entity.d.ts +1 -1
  150. package/script/types/0_thumbnail.js +6 -6
  151. package/script/types/1_bot_command_scope.d.ts +1 -1
  152. package/script/types/1_photo.js +7 -7
  153. package/script/types/1_story_privacy.d.ts +1 -1
  154. package/script/types/2_business_connection.d.ts +11 -0
  155. package/script/types/2_business_connection.js +16 -0
  156. package/script/types/2_chat_member.d.ts +1 -1
  157. package/script/types/2_chosen_inline_result.d.ts +1 -1
  158. package/script/types/2_game.js +3 -3
  159. package/script/types/2_inline_keyboard_button.d.ts +1 -1
  160. package/script/types/2_inline_query.d.ts +1 -1
  161. package/script/types/2_invite_link.d.ts +1 -1
  162. package/script/types/2_message_reaction_count.d.ts +1 -1
  163. package/script/types/2_message_reactions.d.ts +1 -1
  164. package/script/types/2_story_content.js +4 -4
  165. package/{esm/types/1_story_interactive_area.d.ts → script/types/2_story_interactive_area.d.ts} +2 -2
  166. package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
  167. package/script/types/3_chat_member_updated.d.ts +1 -1
  168. package/script/types/3_reply_markup.d.ts +1 -1
  169. package/script/types/3_story.d.ts +2 -2
  170. package/script/types/3_story.js +2 -2
  171. package/script/types/4_inline_query_result.d.ts +1 -1
  172. package/script/types/4_inline_query_result.js +2 -2
  173. package/script/types/4_message.d.ts +9 -3
  174. package/script/types/4_message.js +37 -20
  175. package/script/types/5_callback_query.d.ts +1 -1
  176. package/script/types/5_callback_query.js +2 -1
  177. package/script/types/5_chat.d.ts +1 -1
  178. package/script/types/6_update.d.ts +12 -2
  179. package/script/types/{0__file_id.js → _file_id.js} +2 -1
  180. /package/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
  181. /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
  182. /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
  183. /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
  184. /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
  185. /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
  186. /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
  187. /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
  188. /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
  189. /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
  190. /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
  191. /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
  192. /package/esm/types/{1__getters.js → _getters.js} +0 -0
  193. /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
  194. /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
  195. /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
  196. /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
  197. /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
  198. /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
  199. /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
  200. /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
  201. /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
  202. /package/script/types/{0_venue.js → 1_venue.js} +0 -0
  203. /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
  204. /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
  205. /package/script/types/{1__getters.js → _getters.js} +0 -0
@@ -14,6 +14,7 @@ var _MessageManager_instances, _MessageManager_c, _MessageManager_LresolveFileId
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.MessageManager = void 0;
16
16
  const _0_deps_js_1 = require("../0_deps.js");
17
+ const _0_errors_js_1 = require("../0_errors.js");
17
18
  const _1_utilities_js_1 = require("../1_utilities.js");
18
19
  const _2_tl_js_1 = require("../2_tl.js");
19
20
  const _3_types_js_1 = require("../3_types.js");
@@ -23,7 +24,7 @@ const _0_html_js_1 = require("./0_html.js");
23
24
  const _0_markdown_js_1 = require("./0_markdown.js");
24
25
  const _0_utilities_js_1 = require("./0_utilities.js");
25
26
  const FALLBACK_MIME_TYPE = "application/octet-stream";
26
- const STICKER_MIME_TYPES = ["image/webp", "video/webp", "application/x-tgsticker"];
27
+ const STICKER_MIME_TYPES = ["image/webp", "video/webm", "application/x-tgsticker"];
27
28
  class MessageManager {
28
29
  constructor(c) {
29
30
  _MessageManager_instances.add(this);
@@ -128,8 +129,8 @@ class MessageManager {
128
129
  const entities = entities_?.length > 0 ? await Promise.all(entities_.map((v) => (0, _3_types_js_2.messageEntityToTlObject)(v, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity))) : undefined;
129
130
  return [text, entities];
130
131
  }
131
- async constructMessage(message_, r) {
132
- return await (0, _3_types_js_2.constructMessage)(message_, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity, this.getMessage.bind(this), __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.getStickerSetName.bind(__classPrivateFieldGet(this, _MessageManager_c, "f").fileManager), r);
132
+ async constructMessage(message_, r, business) {
133
+ return await (0, _3_types_js_2.constructMessage)(message_, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity, this.getMessage.bind(this), __classPrivateFieldGet(this, _MessageManager_c, "f").fileManager.getStickerSetName.bind(__classPrivateFieldGet(this, _MessageManager_c, "f").fileManager), r, business);
133
134
  }
134
135
  async forwardMessages(from, to, messageIds, params) {
135
136
  const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.forwardMessages({
@@ -195,7 +196,7 @@ class MessageManager {
195
196
  const sendAs = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveSendAs).call(this, params);
196
197
  let result;
197
198
  if (!noWebpage && params?.linkPreview?.url) {
198
- result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendMedia({
199
+ result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMedia({
199
200
  peer,
200
201
  random_id: randomId,
201
202
  media: new _2_tl_js_1.types.InputMediaWebPage({
@@ -212,10 +213,10 @@ class MessageManager {
212
213
  send_as: sendAs,
213
214
  entities,
214
215
  reply_markup: replyMarkup,
215
- });
216
+ }), params?.businessConnectionId);
216
217
  }
217
218
  else {
218
- result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendMessage({
219
+ result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMessage({
219
220
  peer,
220
221
  random_id: randomId,
221
222
  message,
@@ -227,9 +228,9 @@ class MessageManager {
227
228
  send_as: sendAs,
228
229
  entities,
229
230
  reply_markup: replyMarkup,
230
- });
231
+ }), params?.businessConnectionId);
231
232
  }
232
- const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
233
+ const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
233
234
  return (0, _3_types_js_2.assertMessageType)(message_, "text");
234
235
  }
235
236
  async sendVenue(chatId, latitude, longitude, title, address, params) {
@@ -239,7 +240,7 @@ class MessageManager {
239
240
  const noforwards = params?.protectContent ? true : undefined;
240
241
  const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined; // TODO: check default sendAs
241
242
  const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
242
- const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendMedia({
243
+ const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMedia({
243
244
  peer,
244
245
  random_id: randomId,
245
246
  silent,
@@ -259,8 +260,8 @@ class MessageManager {
259
260
  provider: "foursquare",
260
261
  }),
261
262
  message: "",
262
- });
263
- const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
263
+ }), params?.businessConnectionId);
264
+ const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
264
265
  return (0, _3_types_js_2.assertMessageType)(message, "venue");
265
266
  }
266
267
  async sendContact(chatId, firstName, number, params) {
@@ -270,7 +271,7 @@ class MessageManager {
270
271
  const noforwards = params?.protectContent ? true : undefined;
271
272
  const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined; // TODO: check default sendAs
272
273
  const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
273
- const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendMedia({
274
+ const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMedia({
274
275
  peer,
275
276
  random_id: randomId,
276
277
  silent,
@@ -285,8 +286,8 @@ class MessageManager {
285
286
  vcard: params?.vcard ?? "",
286
287
  }),
287
288
  message: "",
288
- });
289
- const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
289
+ }), params?.businessConnectionId);
290
+ const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
290
291
  return (0, _3_types_js_2.assertMessageType)(message, "contact");
291
292
  }
292
293
  async sendDice(chatId, params) {
@@ -296,7 +297,7 @@ class MessageManager {
296
297
  const noforwards = params?.protectContent ? true : undefined;
297
298
  const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined; // TODO: check default sendAs
298
299
  const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
299
- const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendMedia({
300
+ const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMedia({
300
301
  peer,
301
302
  random_id: randomId,
302
303
  silent,
@@ -308,8 +309,8 @@ class MessageManager {
308
309
  emoticon: params?.emoji ?? "🎲",
309
310
  }),
310
311
  message: "",
311
- });
312
- const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
312
+ }), params?.businessConnectionId);
313
+ const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
313
314
  return (0, _3_types_js_2.assertMessageType)(message, "dice");
314
315
  }
315
316
  async sendLocation(chatId, latitude, longitude, params) {
@@ -319,7 +320,7 @@ class MessageManager {
319
320
  const noforwards = params?.protectContent ? true : undefined;
320
321
  const sendAs = params?.sendAs ? await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(params.sendAs) : undefined; // TODO: check default sendAs
321
322
  const replyMarkup = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params);
322
- const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendMedia({
323
+ const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMedia({
323
324
  peer,
324
325
  random_id: randomId,
325
326
  silent,
@@ -346,8 +347,8 @@ class MessageManager {
346
347
  }),
347
348
  }),
348
349
  message: "",
349
- });
350
- const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
350
+ }), params?.businessConnectionId);
351
+ const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
351
352
  return (0, _3_types_js_2.assertMessageType)(message, "location");
352
353
  }
353
354
  async sendVideoNote(chatId, audio, params) {
@@ -486,7 +487,7 @@ class MessageManager {
486
487
  solution,
487
488
  solution_entities: solutionEntities,
488
489
  });
489
- const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendMedia({
490
+ const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMedia({
490
491
  peer,
491
492
  random_id: randomId,
492
493
  silent,
@@ -496,8 +497,8 @@ class MessageManager {
496
497
  send_as: sendAs,
497
498
  media,
498
499
  message: "",
499
- });
500
- const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
500
+ }), params?.businessConnectionId);
501
+ const message = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
501
502
  return (0, _3_types_js_2.assertMessageType)(message, "poll");
502
503
  }
503
504
  async editMessageReplyMarkup(chatId, messageId, params) {
@@ -576,12 +577,9 @@ class MessageManager {
576
577
  }
577
578
  }
578
579
  async deleteChatMemberMessages(chatId, memberId) {
579
- const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
580
- if (!(channel instanceof _2_tl_js_1.types.InputPeerChannel)) {
581
- throw new Error("Invalid chat ID");
582
- }
580
+ const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
583
581
  const participant = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(memberId);
584
- await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.deleteParticipantHistory({ channel: new _2_tl_js_1.types.InputChannel(channel), participant });
582
+ await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.deleteParticipantHistory({ channel, participant });
585
583
  }
586
584
  async pinMessage(chatId, messageId, params) {
587
585
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.updatePinnedMessage({
@@ -636,6 +634,9 @@ class MessageManager {
636
634
  update instanceof _2_tl_js_1.types.UpdateNewChannelMessage ||
637
635
  update instanceof _2_tl_js_1.types.UpdateEditMessage ||
638
636
  update instanceof _2_tl_js_1.types.UpdateEditChannelMessage ||
637
+ update instanceof _2_tl_js_1.types.UpdateBotNewBusinessMessage ||
638
+ update instanceof _2_tl_js_1.types.UpdateBotEditBusinessMessage ||
639
+ update instanceof _2_tl_js_1.types.UpdateBotDeleteBusinessMessage ||
639
640
  update instanceof _2_tl_js_1.types.UpdateDeleteMessages ||
640
641
  update instanceof _2_tl_js_1.types.UpdateDeleteChannelMessages ||
641
642
  update instanceof _2_tl_js_1.types.UpdateChannelParticipant ||
@@ -651,7 +652,9 @@ class MessageManager {
651
652
  if (update instanceof _2_tl_js_1.types.UpdateNewMessage ||
652
653
  update instanceof _2_tl_js_1.types.UpdateNewChannelMessage ||
653
654
  update instanceof _2_tl_js_1.types.UpdateEditMessage ||
654
- update instanceof _2_tl_js_1.types.UpdateEditChannelMessage) {
655
+ update instanceof _2_tl_js_1.types.UpdateEditChannelMessage ||
656
+ update instanceof _2_tl_js_1.types.UpdateBotNewBusinessMessage ||
657
+ update instanceof _2_tl_js_1.types.UpdateBotEditBusinessMessage) {
655
658
  if (!(update.message instanceof _2_tl_js_1.types.MessageEmpty)) {
656
659
  const isOutgoing = update.message.out;
657
660
  let shouldIgnore = isOutgoing ? (await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.getAccountType()) == "user" ? false : true : false;
@@ -659,8 +662,9 @@ class MessageManager {
659
662
  shouldIgnore = __classPrivateFieldGet(this, _MessageManager_c, "f").ignoreOutgoing;
660
663
  }
661
664
  if (!shouldIgnore) {
662
- const message = await this.constructMessage(update.message);
663
- if (update instanceof _2_tl_js_1.types.UpdateNewMessage || update instanceof _2_tl_js_1.types.UpdateNewChannelMessage) {
665
+ const business = "connection_id" in update ? { connectionId: update.connection_id, replyToMessage: update.reply_to_message } : undefined;
666
+ const message = await this.constructMessage(update.message, undefined, business);
667
+ if (update instanceof _2_tl_js_1.types.UpdateNewMessage || update instanceof _2_tl_js_1.types.UpdateNewChannelMessage || update instanceof _2_tl_js_1.types.UpdateBotNewBusinessMessage) {
664
668
  return ({ message });
665
669
  }
666
670
  else {
@@ -692,6 +696,11 @@ class MessageManager {
692
696
  }
693
697
  return { deletedMessages };
694
698
  }
699
+ else if (update instanceof _2_tl_js_1.types.UpdateBotDeleteBusinessMessage) {
700
+ const chatId = (0, _2_tl_js_1.peerToChatId)(update.peer);
701
+ const deletedMessages = update.messages.map((v) => ({ chatId, messageId: v }));
702
+ return { deletedMessages, businessConnectionId: update.connection_id };
703
+ }
695
704
  if (update instanceof _2_tl_js_1.types.UpdateChannelParticipant || update instanceof _2_tl_js_1.types.UpdateChatParticipant) {
696
705
  const chatMember = await (0, _3_types_js_1.constructChatMemberUpdated)(update, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
697
706
  const selfId = await __classPrivateFieldGet(this, _MessageManager_c, "f").getSelfId();
@@ -741,9 +750,9 @@ class MessageManager {
741
750
  action_ = new _2_tl_js_1.types.SendMessageUploadRoundAction({ progress: 0 });
742
751
  break;
743
752
  default:
744
- throw new Error("Invalid chat action: " + action);
753
+ throw new _0_errors_js_1.InputError(`Invalid chat action: ${action}`);
745
754
  }
746
- await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.setTyping({ peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), action: action_, top_msg_id: params?.messageThreadId });
755
+ await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.setTyping({ peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId), action: action_, top_msg_id: params?.messageThreadId }), params?.businessConnectionId);
747
756
  }
748
757
  async deleteChatPhoto(chatId) {
749
758
  const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
@@ -775,7 +784,7 @@ class MessageManager {
775
784
  async banChatMember(chatId, memberId, params) {
776
785
  const chat = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
777
786
  if (!(chat instanceof _2_tl_js_1.types.InputPeerChannel) && !(chat instanceof _2_tl_js_1.types.InputPeerChat)) {
778
- throw new Error("Invalid chat ID");
787
+ throw new _0_errors_js_1.InputError("Expected a channel, supergroup, or group ID.");
779
788
  }
780
789
  const member = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(memberId);
781
790
  if (chat instanceof _2_tl_js_1.types.InputPeerChannel) {
@@ -805,7 +814,7 @@ class MessageManager {
805
814
  }
806
815
  else if (chat instanceof _2_tl_js_1.types.InputPeerChat) {
807
816
  if (!(member instanceof _2_tl_js_1.types.InputPeerUser)) {
808
- throw new Error("Invalid user ID");
817
+ throw new _0_errors_js_1.InputError(`Invalid user ID: ${memberId}`);
809
818
  }
810
819
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.deleteChatUser({
811
820
  chat_id: chat.chat_id,
@@ -815,25 +824,19 @@ class MessageManager {
815
824
  }
816
825
  }
817
826
  async unbanChatMember(chatId, memberId) {
818
- const chat = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
819
- if (!(chat instanceof _2_tl_js_1.types.InputPeerChannel)) {
820
- throw new Error("Invalid chat ID");
821
- }
827
+ const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
822
828
  const member = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(memberId);
823
829
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.editBanned({
824
- channel: new _2_tl_js_1.types.InputChannel(chat),
830
+ channel,
825
831
  participant: member,
826
832
  banned_rights: new _2_tl_js_1.types.ChatBannedRights({ until_date: 0 }),
827
833
  });
828
834
  }
829
835
  async setChatMemberRights(chatId, memberId, params) {
830
- const chat = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
831
- if (!(chat instanceof _2_tl_js_1.types.InputPeerChannel)) {
832
- throw new Error("Invalid chat ID");
833
- }
836
+ const channel = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputChannel(chatId);
834
837
  const member = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(memberId);
835
838
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.editBanned({
836
- channel: new _2_tl_js_1.types.InputChannel(chat),
839
+ channel,
837
840
  participant: member,
838
841
  banned_rights: (0, _3_types_js_2.chatMemberRightsToTlObject)(params?.rights, params?.untilDate),
839
842
  });
@@ -912,7 +915,7 @@ class MessageManager {
912
915
  }
913
916
  async createInviteLink(chatId, params) {
914
917
  if (params?.requireApproval && params?.limit) {
915
- throw new Error("createInviteLink: requireApproval cannot be true while limit is specified");
918
+ throw new _0_errors_js_1.InputError("requireApproval cannot be true while limit is specified.");
916
919
  }
917
920
  const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.exportChatInvite({
918
921
  peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
@@ -939,7 +942,7 @@ class MessageManager {
939
942
  await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("joinChat");
940
943
  const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
941
944
  if (peer instanceof _2_tl_js_1.types.InputPeerUser) {
942
- throw new Error("joinChat: cannot join private chats");
945
+ throw new _0_errors_js_1.InputError("Cannot join private chats.");
943
946
  }
944
947
  else if (peer instanceof _2_tl_js_1.types.InputPeerChannel) {
945
948
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.joinChannel({ channel: new _2_tl_js_1.types.InputChannel(peer) });
@@ -954,7 +957,7 @@ class MessageManager {
954
957
  async leaveChat(chatId) {
955
958
  const peer = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId);
956
959
  if (peer instanceof _2_tl_js_1.types.InputPeerUser) {
957
- throw new Error("leaveChat: cannot leave private chats");
960
+ throw new _0_errors_js_1.InputError("Cannot leave private chats.");
958
961
  }
959
962
  else if (peer instanceof _2_tl_js_1.types.InputPeerChannel) {
960
963
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.channels.leaveChannel({ channel: new _2_tl_js_1.types.InputChannel(peer) });
@@ -970,7 +973,7 @@ class MessageManager {
970
973
  await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("blockUser");
971
974
  const id = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(userId);
972
975
  if (!(id instanceof _2_tl_js_1.types.User)) {
973
- throw new Error("blockUser: only users can be blocked or unblocked");
976
+ throw new _0_errors_js_1.InputError("Only users can be blocked or unblocked.");
974
977
  }
975
978
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.contacts.block({ id });
976
979
  }
@@ -978,7 +981,7 @@ class MessageManager {
978
981
  await __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertUser("unblockUser");
979
982
  const id = await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(userId);
980
983
  if (!(id instanceof _2_tl_js_1.types.User)) {
981
- throw new Error("unblockUser: only users can be blocked or unblocked");
984
+ throw new _0_errors_js_1.InputError("Only users can be blocked or unblocked.");
982
985
  }
983
986
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.contacts.unblock({ id });
984
987
  }
@@ -998,7 +1001,7 @@ class MessageManager {
998
1001
  return await (0, _3_types_js_2.constructChatMember)(participant, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
999
1002
  }
1000
1003
  else {
1001
- throw new Error("Invalid chat ID");
1004
+ throw new _0_errors_js_1.InputError("Expected a channel, supergroup, or group ID. Got a user ID instead.");
1002
1005
  }
1003
1006
  }
1004
1007
  async setChatStickerSet(chatId, setName) {
@@ -1011,24 +1014,30 @@ class MessageManager {
1011
1014
  }
1012
1015
  async stopPoll(chatId, messageId, params) {
1013
1016
  const message = await this.getMessage(chatId, messageId);
1014
- if (message && "poll" in message && !message.poll.isClosed) {
1015
- const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.editMessage({
1016
- peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
1017
- id: messageId,
1018
- media: new _2_tl_js_1.types.InputMediaPoll({
1019
- poll: new _2_tl_js_1.types.Poll({
1020
- id: BigInt(message.poll.id),
1021
- closed: true,
1022
- question: "",
1023
- answers: [],
1024
- }),
1025
- }),
1026
- reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
1027
- });
1028
- const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
1029
- return (0, _3_types_js_2.assertMessageType)(message_, "poll").poll;
1017
+ if (!message) {
1018
+ throw new _0_errors_js_1.InputError("Message not found.");
1030
1019
  }
1031
- (0, _1_utilities_js_1.UNREACHABLE)();
1020
+ if (!("poll" in message)) {
1021
+ throw new _0_errors_js_1.InputError("Message is not a poll.");
1022
+ }
1023
+ if (message.poll.isClosed) {
1024
+ throw new _0_errors_js_1.InputError("Poll is already stopped.");
1025
+ }
1026
+ const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.editMessage({
1027
+ peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
1028
+ id: messageId,
1029
+ media: new _2_tl_js_1.types.InputMediaPoll({
1030
+ poll: new _2_tl_js_1.types.Poll({
1031
+ id: BigInt(message.poll.id),
1032
+ closed: true,
1033
+ question: "",
1034
+ answers: [],
1035
+ }),
1036
+ }),
1037
+ reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params),
1038
+ });
1039
+ const message_ = await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
1040
+ return (0, _3_types_js_2.assertMessageType)(message_, "poll").poll;
1032
1041
  }
1033
1042
  async editMessageLiveLocation(chatId, messageId, latitude, longitude, params) {
1034
1043
  const message = await this.getMessage(chatId, messageId);
@@ -1071,7 +1080,7 @@ class MessageManager {
1071
1080
  }
1072
1081
  }
1073
1082
  exports.MessageManager = MessageManager;
1074
- _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(), _MessageManager_instances = new WeakSet(), _MessageManager_updatesToMessages = async function _MessageManager_updatesToMessages(chatId, updates) {
1083
+ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(), _MessageManager_instances = new WeakSet(), _MessageManager_updatesToMessages = async function _MessageManager_updatesToMessages(chatId, updates, businessConnectionId) {
1075
1084
  const messages = new Array();
1076
1085
  if (updates instanceof _2_tl_js_1.types.Updates) {
1077
1086
  for (const update of updates.updates) {
@@ -1084,6 +1093,12 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
1084
1093
  else if (update instanceof _2_tl_js_1.types.UpdateNewChannelMessage || update instanceof _2_tl_js_1.types.UpdateEditChannelMessage) {
1085
1094
  messages.push(await this.constructMessage(update.message));
1086
1095
  }
1096
+ else if (update instanceof _2_tl_js_1.types.UpdateBotNewBusinessMessage) {
1097
+ messages.push(await this.constructMessage(update.message, false, { connectionId: businessConnectionId ?? update.connection_id, replyToMessage: update.reply_to_message }));
1098
+ }
1099
+ else if (update instanceof _2_tl_js_1.types.UpdateBotEditBusinessMessage) {
1100
+ messages.push(await this.constructMessage(update.message, false, { connectionId: businessConnectionId ?? update.connection_id, replyToMessage: update.reply_to_message }));
1101
+ }
1087
1102
  }
1088
1103
  }
1089
1104
  else if (updates instanceof _2_tl_js_1.types.UpdateShortSentMessage) {
@@ -1124,7 +1139,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
1124
1139
  if (media == null) {
1125
1140
  if (typeof document === "string" && (0, _0_utilities_js_1.isHttpUrl)(document)) {
1126
1141
  if (!urlSupported) {
1127
- throw new Error("URL not supported");
1142
+ throw new _0_errors_js_1.InputError("URL not supported.");
1128
1143
  }
1129
1144
  media = new _2_tl_js_1.types.InputMediaDocumentExternal({ url: document, spoiler });
1130
1145
  }
@@ -1167,7 +1182,7 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
1167
1182
  const parseResult = caption_ !== undefined ? await this.parseText(caption_, { parseMode: params?.parseMode, entities: params?.captionEntities }) : undefined;
1168
1183
  const caption = parseResult === undefined ? undefined : parseResult[0];
1169
1184
  const captionEntities = parseResult === undefined ? undefined : parseResult[1];
1170
- const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendMedia({
1185
+ const result = await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke(new _2_tl_js_1.functions.messages.sendMedia({
1171
1186
  peer,
1172
1187
  random_id: randomId,
1173
1188
  silent,
@@ -1178,8 +1193,8 @@ _MessageManager_c = new WeakMap(), _MessageManager_LresolveFileId = new WeakMap(
1178
1193
  media,
1179
1194
  message: caption ?? "",
1180
1195
  entities: captionEntities,
1181
- });
1182
- return await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result).then((v) => v[0]);
1196
+ }), params?.businessConnectionId);
1197
+ return await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_updatesToMessages).call(this, chatId, result, params?.businessConnectionId).then((v) => v[0]);
1183
1198
  }, _MessageManager_sendReaction = async function _MessageManager_sendReaction(chatId, messageId, reactions, params) {
1184
1199
  await __classPrivateFieldGet(this, _MessageManager_c, "f").api.messages.sendReaction({
1185
1200
  peer: await __classPrivateFieldGet(this, _MessageManager_c, "f").getInputPeer(chatId),
@@ -13,6 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
13
13
  var _ChatListManager_instances, _ChatListManager_c, _ChatListManager_LgetChats, _ChatListManager_sendChatUpdate, _ChatListManager_chats, _ChatListManager_archivedChats, _ChatListManager_chatsLoadedFromStorage, _ChatListManager_tryGetChatId, _ChatListManager_getChatAnywhere, _ChatListManager_getChatList, _ChatListManager_loadChatsFromStorage, _ChatListManager_getLoadedChats, _ChatListManager_pinnedChats, _ChatListManager_pinnedArchiveChats, _ChatListManager_storageHadPinnedChats, _ChatListManager_pinnedChatsLoaded, _ChatListManager_loadPinnedChats, _ChatListManager_fetchPinnedChats, _ChatListManager_getPinnedChats, _ChatListManager_updateOrAddChat, _ChatListManager_removeChat, _ChatListManager_handleUpdateFolderPeers, _ChatListManager_handleUpdatePinnedDialogs, _ChatListManager_handleUpdateChannel, _ChatListManager_handleUpdateChat, _ChatListManager_handleUpdateUser, _ChatListManager_fetchChats;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.ChatListManager = void 0;
16
+ const _0_errors_js_1 = require("../0_errors.js");
16
17
  const _1_utilities_js_1 = require("../1_utilities.js");
17
18
  const _2_tl_js_1 = require("../2_tl.js");
18
19
  const _3_types_js_1 = require("../3_types.js");
@@ -101,7 +102,7 @@ class ChatListManager {
101
102
  await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_loadChatsFromStorage).call(this);
102
103
  }
103
104
  if (after && !__classPrivateFieldGet(this, _ChatListManager_chats, "f").get(after.id)) {
104
- throw new Error("Invalid after");
105
+ throw new _0_errors_js_1.InputError("Invalid after");
105
106
  }
106
107
  if (limit <= 0 || limit > 100) {
107
108
  limit = 100;
@@ -262,7 +263,7 @@ _ChatListManager_c = new WeakMap(), _ChatListManager_LgetChats = new WeakMap(),
262
263
  case 1:
263
264
  return __classPrivateFieldGet(this, _ChatListManager_archivedChats, "f");
264
265
  default:
265
- throw new Error("Invalid chat list: " + listId);
266
+ throw new Error(`Invalid chat list: ${listId}`);
266
267
  }
267
268
  }, _ChatListManager_loadChatsFromStorage = async function _ChatListManager_loadChatsFromStorage() {
268
269
  const chats = await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.getChats(0);
@@ -14,6 +14,7 @@ var _StoryManager_instances, _StoryManager_c, _StoryManager_updatesToStory, _Sto
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.StoryManager = void 0;
16
16
  const _0_deps_js_1 = require("../0_deps.js");
17
+ const _0_errors_js_1 = require("../0_errors.js");
17
18
  const _1_utilities_js_1 = require("../1_utilities.js");
18
19
  const _2_tl_js_1 = require("../2_tl.js");
19
20
  const _3_types_js_1 = require("../3_types.js");
@@ -38,7 +39,7 @@ class StoryManager {
38
39
  }
39
40
  if (media == null) {
40
41
  if (typeof source === "string" && (0, _0_utilities_js_1.isHttpUrl)(source)) {
41
- throw new Error("URL not supported");
42
+ throw new _0_errors_js_1.InputError("URL not supported.");
42
43
  }
43
44
  else {
44
45
  const [contents, fileName_] = await (0, _0_utilities_js_1.getFileContents)(source);