@mtkruto/node 0.161.0 → 0.170.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/esm/0_deps.d.ts +1 -1
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +1 -1
  4. package/esm/2_tl.d.ts +1 -0
  5. package/esm/2_tl.d.ts.map +1 -1
  6. package/esm/2_tl.js +1 -0
  7. package/esm/3_types.d.ts +3 -0
  8. package/esm/3_types.d.ts.map +1 -1
  9. package/esm/3_types.js +3 -0
  10. package/esm/client/0_markdown.d.ts.map +1 -1
  11. package/esm/client/0_params.d.ts +38 -4
  12. package/esm/client/0_params.d.ts.map +1 -1
  13. package/esm/client/0_secret_chat_state.d.ts +86 -0
  14. package/esm/client/0_secret_chat_state.d.ts.map +1 -0
  15. package/esm/client/0_secret_chat_state.js +129 -0
  16. package/esm/client/0_storage_operations.d.ts +1 -0
  17. package/esm/client/0_storage_operations.d.ts.map +1 -1
  18. package/esm/client/0_storage_operations.js +3 -0
  19. package/esm/client/1_client_generic.d.ts +86 -15
  20. package/esm/client/1_client_generic.d.ts.map +1 -1
  21. package/esm/client/2_client_encrypted.js +6 -6
  22. package/esm/client/2_file_manager.d.ts.map +1 -1
  23. package/esm/client/2_file_manager.js +26 -3
  24. package/esm/client/3_account_manager.js +3 -3
  25. package/esm/client/3_filters.d.ts +16 -7
  26. package/esm/client/3_filters.d.ts.map +1 -1
  27. package/esm/client/3_message_manager.d.ts +59 -20
  28. package/esm/client/3_message_manager.d.ts.map +1 -1
  29. package/esm/client/3_message_manager.js +6 -0
  30. package/esm/client/3_secret_chat_manager.d.ts +26 -0
  31. package/esm/client/3_secret_chat_manager.d.ts.map +1 -0
  32. package/esm/client/3_secret_chat_manager.js +770 -0
  33. package/esm/client/4_chat_manager.d.ts +2 -0
  34. package/esm/client/4_chat_manager.d.ts.map +1 -1
  35. package/esm/client/4_chat_manager.js +12 -0
  36. package/esm/client/4_poll_manager.js +2 -2
  37. package/esm/client/6_client.d.ts +87 -16
  38. package/esm/client/6_client.d.ts.map +1 -1
  39. package/esm/client/6_client.js +118 -18
  40. package/esm/client/6_client_dispatcher.d.ts +86 -15
  41. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  42. package/esm/client/6_client_dispatcher.js +107 -15
  43. package/esm/session/2_session_encrypted.js +5 -5
  44. package/esm/tl/1_secret_chats_api.d.ts +637 -0
  45. package/esm/tl/1_secret_chats_api.d.ts.map +1 -0
  46. package/esm/tl/1_secret_chats_api.js +849 -0
  47. package/esm/tl/1_tl_reader.js +3 -3
  48. package/esm/tl/2_secret_chats.d.ts +33 -0
  49. package/esm/tl/2_secret_chats.d.ts.map +1 -0
  50. package/esm/tl/2_secret_chats.js +53 -0
  51. package/esm/types/0_secret_chat.d.ts +66 -0
  52. package/esm/types/0_secret_chat.d.ts.map +1 -0
  53. package/esm/types/0_secret_chat.js +30 -0
  54. package/esm/types/0_secret_message_entity.d.ts +115 -0
  55. package/esm/types/0_secret_message_entity.d.ts.map +1 -0
  56. package/esm/types/0_secret_message_entity.js +174 -0
  57. package/esm/types/1_chat_p.d.ts +3 -3
  58. package/esm/types/1_chat_p.d.ts.map +1 -1
  59. package/esm/types/1_input_poll_media.d.ts +2 -2
  60. package/esm/types/1_sticker.d.ts +2 -1
  61. package/esm/types/1_sticker.d.ts.map +1 -1
  62. package/esm/types/1_sticker.js +23 -1
  63. package/esm/types/2_inactive_chat.d.ts +1 -1
  64. package/esm/types/2_inactive_chat.d.ts.map +1 -1
  65. package/esm/types/2_message_entity.d.ts +0 -3
  66. package/esm/types/2_message_entity.d.ts.map +1 -1
  67. package/esm/types/2_secret_message.d.ts +184 -0
  68. package/esm/types/2_secret_message.d.ts.map +1 -0
  69. package/esm/types/2_secret_message.js +341 -0
  70. package/esm/types/2_user.d.ts +1 -1
  71. package/esm/types/2_user.d.ts.map +1 -1
  72. package/esm/types/3_input_media.d.ts +2 -2
  73. package/esm/types/4_gift.d.ts +2 -2
  74. package/esm/types/4_gift.d.ts.map +1 -1
  75. package/esm/types/9_message.d.ts +8 -60
  76. package/esm/types/9_message.d.ts.map +1 -1
  77. package/esm/types/9_message.js +1 -0
  78. package/esm/types/B_update.d.ts +32 -41
  79. package/esm/types/B_update.d.ts.map +1 -1
  80. package/package.json +1 -1
  81. package/script/0_deps.d.ts +1 -1
  82. package/script/0_deps.d.ts.map +1 -1
  83. package/script/0_deps.js +2 -1
  84. package/script/2_tl.d.ts +1 -0
  85. package/script/2_tl.d.ts.map +1 -1
  86. package/script/2_tl.js +2 -1
  87. package/script/3_types.d.ts +3 -0
  88. package/script/3_types.d.ts.map +1 -1
  89. package/script/3_types.js +3 -0
  90. package/script/client/0_markdown.d.ts.map +1 -1
  91. package/script/client/0_params.d.ts +38 -4
  92. package/script/client/0_params.d.ts.map +1 -1
  93. package/script/client/0_secret_chat_state.d.ts +86 -0
  94. package/script/client/0_secret_chat_state.d.ts.map +1 -0
  95. package/script/client/0_secret_chat_state.js +133 -0
  96. package/script/client/0_storage_operations.d.ts +1 -0
  97. package/script/client/0_storage_operations.d.ts.map +1 -1
  98. package/script/client/0_storage_operations.js +3 -0
  99. package/script/client/1_client_generic.d.ts +86 -15
  100. package/script/client/1_client_generic.d.ts.map +1 -1
  101. package/script/client/2_client_encrypted.js +6 -6
  102. package/script/client/2_file_manager.d.ts.map +1 -1
  103. package/script/client/2_file_manager.js +25 -2
  104. package/script/client/3_account_manager.js +3 -3
  105. package/script/client/3_filters.d.ts +16 -7
  106. package/script/client/3_filters.d.ts.map +1 -1
  107. package/script/client/3_message_manager.d.ts +59 -20
  108. package/script/client/3_message_manager.d.ts.map +1 -1
  109. package/script/client/3_message_manager.js +6 -0
  110. package/script/client/3_secret_chat_manager.d.ts +26 -0
  111. package/script/client/3_secret_chat_manager.d.ts.map +1 -0
  112. package/script/client/3_secret_chat_manager.js +807 -0
  113. package/script/client/4_chat_manager.d.ts +2 -0
  114. package/script/client/4_chat_manager.d.ts.map +1 -1
  115. package/script/client/4_chat_manager.js +12 -0
  116. package/script/client/4_poll_manager.js +2 -2
  117. package/script/client/6_client.d.ts +87 -16
  118. package/script/client/6_client.d.ts.map +1 -1
  119. package/script/client/6_client.js +118 -18
  120. package/script/client/6_client_dispatcher.d.ts +86 -15
  121. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  122. package/script/client/6_client_dispatcher.js +107 -15
  123. package/script/session/2_session_encrypted.js +5 -5
  124. package/script/tl/1_secret_chats_api.d.ts +637 -0
  125. package/script/tl/1_secret_chats_api.d.ts.map +1 -0
  126. package/script/tl/1_secret_chats_api.js +852 -0
  127. package/script/tl/1_tl_reader.js +3 -3
  128. package/script/tl/2_secret_chats.d.ts +33 -0
  129. package/script/tl/2_secret_chats.d.ts.map +1 -0
  130. package/script/tl/2_secret_chats.js +78 -0
  131. package/script/types/0_secret_chat.d.ts +66 -0
  132. package/script/types/0_secret_chat.d.ts.map +1 -0
  133. package/script/types/0_secret_chat.js +33 -0
  134. package/script/types/0_secret_message_entity.d.ts +115 -0
  135. package/script/types/0_secret_message_entity.d.ts.map +1 -0
  136. package/script/types/0_secret_message_entity.js +179 -0
  137. package/script/types/1_chat_p.d.ts +3 -3
  138. package/script/types/1_chat_p.d.ts.map +1 -1
  139. package/script/types/1_input_poll_media.d.ts +2 -2
  140. package/script/types/1_sticker.d.ts +2 -1
  141. package/script/types/1_sticker.d.ts.map +1 -1
  142. package/script/types/1_sticker.js +23 -0
  143. package/script/types/2_inactive_chat.d.ts +1 -1
  144. package/script/types/2_inactive_chat.d.ts.map +1 -1
  145. package/script/types/2_message_entity.d.ts +0 -3
  146. package/script/types/2_message_entity.d.ts.map +1 -1
  147. package/script/types/2_secret_message.d.ts +184 -0
  148. package/script/types/2_secret_message.d.ts.map +1 -0
  149. package/script/types/2_secret_message.js +344 -0
  150. package/script/types/2_user.d.ts +1 -1
  151. package/script/types/2_user.d.ts.map +1 -1
  152. package/script/types/3_input_media.d.ts +2 -2
  153. package/script/types/4_gift.d.ts +2 -2
  154. package/script/types/4_gift.d.ts.map +1 -1
  155. package/script/types/9_message.d.ts +8 -60
  156. package/script/types/9_message.d.ts.map +1 -1
  157. package/script/types/9_message.js +1 -0
  158. package/script/types/B_update.d.ts +32 -41
  159. package/script/types/B_update.d.ts.map +1 -1
@@ -50,6 +50,7 @@ const _2_update_manager_js_1 = require("./2_update_manager.js");
50
50
  const _3_account_manager_js_1 = require("./3_account_manager.js");
51
51
  const _3_client_encrypted_pool_js_1 = require("./3_client_encrypted_pool.js");
52
52
  const _3_message_manager_js_1 = require("./3_message_manager.js");
53
+ const _3_secret_chat_manager_js_1 = require("./3_secret_chat_manager.js");
53
54
  const _3_sticker_set_manager_js_1 = require("./3_sticker_set_manager.js");
54
55
  const _3_video_chat_manager_js_1 = require("./3_video_chat_manager.js");
55
56
  const _4_callback_query_manager_js_1 = require("./4_callback_query_manager.js");
@@ -93,6 +94,7 @@ class Client extends _5_composer_js_1.Composer {
93
94
  // 3_
94
95
  #accountManager;
95
96
  #messageManager;
97
+ #secretChatManager;
96
98
  #stickerSetManager;
97
99
  #videoChatManager;
98
100
  // 4_
@@ -128,6 +130,7 @@ class Client extends _5_composer_js_1.Composer {
128
130
  // 3_
129
131
  accountManager: this.#accountManager,
130
132
  messageManager: this.#messageManager,
133
+ secretChatManager: this.#secretChatManager,
131
134
  stickerSetManager: this.#stickerSetManager,
132
135
  videoChatManager: this.#videoChatManager,
133
136
  // 4_
@@ -264,6 +267,7 @@ class Client extends _5_composer_js_1.Composer {
264
267
  // 3_
265
268
  this.#accountManager = new _3_account_manager_js_1.AccountManager({ ...c, fileManager });
266
269
  const messageManager = this.#messageManager = new _3_message_manager_js_1.MessageManager({ ...c, fileManager });
270
+ this.#secretChatManager = new _3_secret_chat_manager_js_1.SecretChatManager({ ...c, fileManager });
267
271
  this.#stickerSetManager = new _3_sticker_set_manager_js_1.StickerSetManager({ ...c, fileManager });
268
272
  this.#videoChatManager = new _3_video_chat_manager_js_1.VideoChatManager({ ...c, fileManager });
269
273
  // 4_
@@ -364,6 +368,7 @@ class Client extends _5_composer_js_1.Composer {
364
368
  await this.storage.deleteUpdates();
365
369
  await this.storage.commit(true);
366
370
  }
371
+ await this.#secretChatManager.loadSecretChats();
367
372
  this.#storageInited = true;
368
373
  }
369
374
  }
@@ -601,7 +606,7 @@ class Client extends _5_composer_js_1.Composer {
601
606
  /**
602
607
  * Check whether a bot token is valid.
603
608
  *
604
- * @param password The password to check
609
+ * @param botToken The bot token to check
605
610
  * @returns The result of the check.
606
611
  * @method ac
607
612
  */
@@ -926,7 +931,7 @@ class Client extends _5_composer_js_1.Composer {
926
931
  async getInputChannel(id) {
927
932
  const inputPeer = await this.getInputPeer(id);
928
933
  if (!(0, _0_utilities_js_1.canBeInputChannel)(inputPeer)) {
929
- throw new TypeError(`The chat ${id} is not a channel neither a supergroup.`);
934
+ throw new TypeError(`The chat ${id} is neither a channel nor a supergroup.`);
930
935
  }
931
936
  return (0, _0_utilities_js_1.toInputChannel)(inputPeer);
932
937
  }
@@ -1015,7 +1020,7 @@ class Client extends _5_composer_js_1.Composer {
1015
1020
  peer = { _: "inputPeerChannel", channel_id: _2_tl_js_1.Api.chatIdToPeerId(id), access_hash: accessHash ?? 0n };
1016
1021
  }
1017
1022
  else {
1018
- throw new _0_errors_js_1.InputError("The ID is of an format unknown.");
1023
+ throw new _0_errors_js_1.InputError("The ID is of an unknown format.");
1019
1024
  }
1020
1025
  if (!_2_tl_js_1.Api.is("inputPeerChat", peer) && !peer.access_hash) {
1021
1026
  // TODO
@@ -1155,6 +1160,9 @@ class Client extends _5_composer_js_1.Composer {
1155
1160
  if (this.#accountManager.canHandleUpdate(update)) {
1156
1161
  maybePromises.push(() => this.#accountManager.handleUpdate(update));
1157
1162
  }
1163
+ if (this.#secretChatManager.canHandleUpdate(update)) {
1164
+ maybePromises.push(() => this.#secretChatManager.handleUpdate(update));
1165
+ }
1158
1166
  return () => Promise.resolve().then(async () => {
1159
1167
  const updates = [{ type: "update", update }];
1160
1168
  for (const maybePromise of maybePromises) {
@@ -1513,7 +1521,7 @@ class Client extends _5_composer_js_1.Composer {
1513
1521
  * Resolve a phone number. User-only.
1514
1522
  *
1515
1523
  * @method ac
1516
- * @param username The phone number to resolve.
1524
+ * @param phoneNumber The phone number to resolve.
1517
1525
  */
1518
1526
  async resolvePhoneNumber(phoneNumber) {
1519
1527
  return await this.#accountManager.resolvePhoneNumber(phoneNumber);
@@ -1750,7 +1758,7 @@ class Client extends _5_composer_js_1.Composer {
1750
1758
  *
1751
1759
  * @method ms
1752
1760
  * @param chatId The identifier of a chat to send the sticker to.
1753
- * @param document The sticker to send.
1761
+ * @param sticker The sticker to send.
1754
1762
  * @returns The sent sticker.
1755
1763
  */
1756
1764
  async sendSticker(chatId, sticker, params) {
@@ -1840,11 +1848,11 @@ class Client extends _5_composer_js_1.Composer {
1840
1848
  * @method ms
1841
1849
  * @param chatId The identifier of a chat to send the contact to.
1842
1850
  * @param firstName The contact's first name.
1843
- * @param number The contact's phone number.
1851
+ * @param phoneNumber The contact's phone number.
1844
1852
  * @returns The sent contact.
1845
1853
  */
1846
- async sendContact(chatId, firstName, number, params) {
1847
- return await this.#messageManager.sendContact(chatId, firstName, number, params);
1854
+ async sendContact(chatId, firstName, phoneNumber, params) {
1855
+ return await this.#messageManager.sendContact(chatId, firstName, phoneNumber, params);
1848
1856
  }
1849
1857
  /**
1850
1858
  * Send a dice.
@@ -1939,7 +1947,6 @@ class Client extends _5_composer_js_1.Composer {
1939
1947
  * @method ms
1940
1948
  * @param chatId The identifier of the chat which the message belongs to.
1941
1949
  * @param messageId The identifier of the message.
1942
- * @param text The new caption of the message.
1943
1950
  * @returns The edited message.
1944
1951
  */
1945
1952
  async editMessageCaption(chatId, messageId, params) {
@@ -2224,7 +2231,6 @@ class Client extends _5_composer_js_1.Composer {
2224
2231
  * @method ms
2225
2232
  * @param chatId The identifier of a chat to send the chat action to.
2226
2233
  * @param action The chat action.
2227
- * @param messageThreadId The thread to send the chat action to.
2228
2234
  */
2229
2235
  async sendChatAction(chatId, action, params) {
2230
2236
  await this.#messageManager.sendChatAction(chatId, action, params);
@@ -2538,6 +2544,16 @@ class Client extends _5_composer_js_1.Composer {
2538
2544
  async unsaveAnimation(fileId) {
2539
2545
  return await this.#messageManager.unsaveAnimation(fileId);
2540
2546
  }
2547
+ /**
2548
+ * Get a message's read date. User-only.
2549
+ *
2550
+ * @method ms
2551
+ * @param chatId The identifier of a chat.
2552
+ * @param messageId The identifier of the message.
2553
+ */
2554
+ async getMessageReadDate(chatId, messageId) {
2555
+ return await this.#messageManager.getMessageReadDate(chatId, messageId);
2556
+ }
2541
2557
  //
2542
2558
  // ========================= POLLS ========================= //
2543
2559
  //
@@ -2577,7 +2593,7 @@ class Client extends _5_composer_js_1.Composer {
2577
2593
  *
2578
2594
  * @param chatId The identifier of the chat that includes the poll.
2579
2595
  * @param messageId The identifier of the message that includes the poll.
2580
- * @param option The identifier of the option to remove.
2596
+ * @param optionId The identifier of the option to remove.
2581
2597
  */
2582
2598
  async removePollOption(chatId, messageId, optionId) {
2583
2599
  await this.#pollManager.removePollOption(chatId, messageId, optionId);
@@ -2995,7 +3011,7 @@ class Client extends _5_composer_js_1.Composer {
2995
3011
  *
2996
3012
  * @method ch
2997
3013
  * @param chatId The identifier of the channel or supergroup to add the users to.
2998
- * @param userId The identifiers of the users to add to the channel or supergroup.
3014
+ * @param userIds The identifiers of the users to add to the channel or supergroup.
2999
3015
  * @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
3000
3016
  */
3001
3017
  async addChatMembers(chatId, userIds) {
@@ -3477,6 +3493,24 @@ class Client extends _5_composer_js_1.Composer {
3477
3493
  async reportChat(chatId, reason, params) {
3478
3494
  return await this.#chatManager.reportChat(chatId, reason, params);
3479
3495
  }
3496
+ /**
3497
+ * Mark a chat as unread. User-only.
3498
+ *
3499
+ * @method ch
3500
+ * @param chatId The identifier of a chat.
3501
+ */
3502
+ async markChatAsUnread(chatId) {
3503
+ return await this.#chatManager.markChatAsUnread(chatId);
3504
+ }
3505
+ /**
3506
+ * Mark a chat as read. User-only.
3507
+ *
3508
+ * @method ch
3509
+ * @param chatId The identifier of a chat.
3510
+ */
3511
+ async markChatAsRead(chatId) {
3512
+ return await this.#chatManager.markChatAsRead(chatId);
3513
+ }
3480
3514
  //
3481
3515
  // ========================= CALLBACK QUERIES ========================= //
3482
3516
  //
@@ -4129,7 +4163,7 @@ class Client extends _5_composer_js_1.Composer {
4129
4163
  * Craft gifts.
4130
4164
  *
4131
4165
  * @method gf
4132
- * @param gift The gifts to craft.
4166
+ * @param gifts The gifts to craft.
4133
4167
  */
4134
4168
  async craftGifts(gifts) {
4135
4169
  await this.#giftManager.craftGifts(gifts);
@@ -4225,7 +4259,7 @@ class Client extends _5_composer_js_1.Composer {
4225
4259
  * @method gc
4226
4260
  * @param chatId The identifier of the chat that includes the gift collection.
4227
4261
  * @param collectionId The identifier of a gift collection.
4228
- * @param gifts The gifts to remove from the collection.
4262
+ * @param gifts The new order of gifts.
4229
4263
  */
4230
4264
  async reorderGiftsInCollection(chatId, collectionId, gifts) {
4231
4265
  return await this.#giftCollectionManager.reorderGiftsInCollection(chatId, collectionId, gifts);
@@ -4279,8 +4313,8 @@ class Client extends _5_composer_js_1.Composer {
4279
4313
  * @method ss
4280
4314
  * @param slug The slug of the sticker set or its link.
4281
4315
  */
4282
- async getStickerSet(name) {
4283
- return await this.#stickerSetManager.getStickerSet(name);
4316
+ async getStickerSet(slug) {
4317
+ return await this.#stickerSetManager.getStickerSet(slug);
4284
4318
  }
4285
4319
  /**
4286
4320
  * Get a dice sticker set.
@@ -4387,8 +4421,8 @@ class Client extends _5_composer_js_1.Composer {
4387
4421
  * @param fileId The identifier of the sticker.
4388
4422
  * @param position The new position of the sticker.
4389
4423
  */
4390
- async changeStickerPositionInStickerSet(slug, position) {
4391
- return await this.#stickerSetManager.changeStickerPositionInStickerSet(slug, position);
4424
+ async changeStickerPositionInStickerSet(fileId, position) {
4425
+ return await this.#stickerSetManager.changeStickerPositionInStickerSet(fileId, position);
4392
4426
  }
4393
4427
  /**
4394
4428
  * Set a sticker set's thumbnail.
@@ -4465,5 +4499,71 @@ class Client extends _5_composer_js_1.Composer {
4465
4499
  async answerGuestQuery(id, result) {
4466
4500
  return await this.#messageManager.answerGuestQuery(id, result);
4467
4501
  }
4502
+ //
4503
+ // ========================= SECRET CHATS ========================= //
4504
+ //
4505
+ /**
4506
+ * Request a secret chat. User-only.
4507
+ *
4508
+ * @method sc
4509
+ * @param chatId The identifier of a chat.
4510
+ */
4511
+ async requestSecretChat(chatId) {
4512
+ return await this.#secretChatManager.requestSecretChat(chatId);
4513
+ }
4514
+ /**
4515
+ * Accept a secret chat. User-only.
4516
+ *
4517
+ * @method sc
4518
+ * @param id The identifier of the secret chat.
4519
+ */
4520
+ async acceptSecretChat(id) {
4521
+ return await this.#secretChatManager.acceptSecretChat(id);
4522
+ }
4523
+ /**
4524
+ * Send a message to a secret chat. User-only.
4525
+ *
4526
+ * @method sc
4527
+ * @param id The identifier of the secret chat.
4528
+ * @param text The message's text.
4529
+ */
4530
+ async sendSecretMessage(id, text, params) {
4531
+ return await this.#secretChatManager.sendSecretMessage(id, text, params);
4532
+ }
4533
+ /**
4534
+ * Send a location to a secret chat. User-only.
4535
+ *
4536
+ * @method sc
4537
+ * @param id The identifier of the secret chat.
4538
+ * @param latitude The location's latitude.
4539
+ * @param longitude The location's longitude.
4540
+ */
4541
+ async sendSecretLocation(id, latitude, longitude, params) {
4542
+ return await this.#secretChatManager.sendSecretLocation(id, latitude, longitude, params);
4543
+ }
4544
+ /**
4545
+ * Send a venue to a secret chat. User-only.
4546
+ *
4547
+ * @method sc
4548
+ * @param id The identifier of the secret chat.
4549
+ * @param latitude The latitude of the venue.
4550
+ * @param longitude The longitude of the venue.
4551
+ * @param title The title of the venue.
4552
+ * @param address The written address of the venue.
4553
+ */
4554
+ async sendSecretVenue(id, latitude, longitude, title, address, params) {
4555
+ return await this.#secretChatManager.sendSecretVenue(id, latitude, longitude, title, address, params);
4556
+ }
4557
+ /**
4558
+ * Send a contact to a secret chat. User-only.
4559
+ *
4560
+ * @method sc
4561
+ * @param id The identifier of the secret chat.
4562
+ * @param firstName The contact's first name.
4563
+ * @param phoneNumber The contact's phone number.
4564
+ */
4565
+ async sendSecretContact(id, firstName, phoneNumber, params) {
4566
+ return await this.#secretChatManager.sendSecretContact(id, firstName, phoneNumber, params);
4567
+ }
4468
4568
  }
4469
4569
  exports.Client = Client;
@@ -1,7 +1,7 @@
1
1
  import type { Api, Mtproto } from "../2_tl.js";
2
2
  import type { DC } from "../3_transport.js";
3
- import type { AlbumStoryList, Animation, AppSupport, AuthorizationSession, AvailableReactions, Birthday, BlockedUserList, BotAccessSettings, BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatActionType, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, Country, FailedInvitation, FileSource, Gift, GiftCollection, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputChecklistItem, InputEmojiStatus, InputGift, InputMedia, InputPollOption, InputRichText, InputSticker, InputStoryContent, InviteLink, JoinRequest, LeftChannelList, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageCounters, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLivePhoto, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, MiniAppInfo, NetworkStatistics, ParseMode, PasswordCheckResult, Poll, PremiumSubscriptionDuration, PriceTag, ProfilePhotoList, Reaction, ReportReason, RichText, SavedChats, SlowModeDuration, StarAmount, StarTransactionList, Sticker, StickerSet, Story, StoryAlbum, StoryReportResult, SummarizedText, TextToTranslate, Timezone, Topic, TranslatedText, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
4
- import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ReportChatParams, ReportStoryParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendRichTextParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
3
+ import type { AlbumStoryList, Animation, AppSupport, AuthorizationSession, AvailableReactions, Birthday, BlockedUserList, BotAccessSettings, BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatActionType, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, Country, FailedInvitation, FileSource, Gift, GiftCollection, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputChecklistItem, InputEmojiStatus, InputGift, InputMedia, InputPollOption, InputRichText, InputSticker, InputStoryContent, InviteLink, JoinRequest, LeftChannelList, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageChecklist, MessageContact, MessageCounters, MessageDice, MessageDocument, MessageInvoice, MessageList, MessageLivePhoto, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageRichText, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, MiniAppInfo, NetworkStatistics, ParseMode, PasswordCheckResult, Poll, PremiumSubscriptionDuration, PriceTag, ProfilePhotoList, Reaction, ReportReason, RichText, SavedChats, SecretChat, SlowModeDuration, StarAmount, StarTransactionList, Sticker, StickerSet, Story, StoryAlbum, StoryReportResult, SummarizedText, TextToTranslate, Timezone, Topic, TranslatedText, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
4
+ import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageRichTextParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageRichTextParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ReportChatParams, ReportStoryParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendRichTextDraftParams, SendRichTextParams, SendSecretContactParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretVenueParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
5
5
  import type { WorkerRequest } from "./0_worker_request.js";
6
6
  import type { ClientGeneric } from "./1_client_generic.js";
7
7
  import { type InvokeErrorHandler } from "./1_invoke_middleware.js";
@@ -49,7 +49,7 @@ export interface ClientDispatcherParams {
49
49
  * When the provided storage takes advantage of memory, nothing changes, even if set to `true`.
50
50
  */
51
51
  persistCache?: boolean;
52
- /** Whether to disable receiving updates. UpdateConnectionState and UpdatesAuthorizationState will always be received. Defaults to `false`. */
52
+ /** Whether to disable receiving updates. UpdateConnectionState and UpdateAuthorizationState will always be received. Defaults to `false`. */
53
53
  disableUpdates?: boolean;
54
54
  /** An auth string to automatically import. Can be overridden by a later importAuthString call. */
55
55
  authString?: string;
@@ -109,7 +109,7 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
109
109
  /**
110
110
  * Check whether a bot token is valid.
111
111
  *
112
- * @param password The password to check
112
+ * @param botToken The bot token to check
113
113
  * @returns The result of the check.
114
114
  * @method ac
115
115
  */
@@ -364,7 +364,7 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
364
364
  * Resolve a phone number. User-only.
365
365
  *
366
366
  * @method ac
367
- * @param username The phone number to resolve.
367
+ * @param phoneNumber The phone number to resolve.
368
368
  */
369
369
  resolvePhoneNumber(phoneNumber: string): Promise<User>;
370
370
  /**
@@ -548,7 +548,7 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
548
548
  *
549
549
  * @method ms
550
550
  * @param chatId The identifier of a chat to send the sticker to.
551
- * @param document The sticker to send.
551
+ * @param sticker The sticker to send.
552
552
  * @returns The sent sticker.
553
553
  */
554
554
  sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
@@ -622,10 +622,10 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
622
622
  * @method ms
623
623
  * @param chatId The identifier of a chat to send the contact to.
624
624
  * @param firstName The contact's first name.
625
- * @param number The contact's phone number.
625
+ * @param phoneNumber The contact's phone number.
626
626
  * @returns The sent contact.
627
627
  */
628
- sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
628
+ sendContact(chatId: ID, firstName: string, phoneNumber: string, params?: SendContactParams): Promise<MessageContact>;
629
629
  /**
630
630
  * Send a dice.
631
631
  *
@@ -705,7 +705,6 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
705
705
  * @method ms
706
706
  * @param chatId The identifier of the chat which the message belongs to.
707
707
  * @param messageId The identifier of the message.
708
- * @param text The new caption of the message.
709
708
  * @returns The edited message.
710
709
  */
711
710
  editMessageCaption(chatId: ID, messageId: number, params?: EditMessageCaptionParams): Promise<Message>;
@@ -938,7 +937,6 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
938
937
  * @method ms
939
938
  * @param chatId The identifier of a chat to send the chat action to.
940
939
  * @param action The chat action.
941
- * @param messageThreadId The thread to send the chat action to.
942
940
  */
943
941
  sendChatAction(chatId: ID, action: ChatActionType, params?: {
944
942
  messageThreadId?: number;
@@ -1180,6 +1178,14 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
1180
1178
  * @param fileId The file identifier of the animation.
1181
1179
  */
1182
1180
  unsaveAnimation(fileId: string): Promise<void>;
1181
+ /**
1182
+ * Get a message's read date. User-only.
1183
+ *
1184
+ * @method ms
1185
+ * @param chatId The identifier of a chat.
1186
+ * @param messageId The identifier of the message.
1187
+ */
1188
+ getMessageReadDate(chatId: ID, messageId: number): Promise<number>;
1183
1189
  /**
1184
1190
  * Cast a vote. User-only.
1185
1191
  *
@@ -1210,7 +1216,7 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
1210
1216
  *
1211
1217
  * @param chatId The identifier of the chat that includes the poll.
1212
1218
  * @param messageId The identifier of the message that includes the poll.
1213
- * @param option The identifier of the option to remove.
1219
+ * @param optionId The identifier of the option to remove.
1214
1220
  */
1215
1221
  removePollOption(chatId: ID, messageId: number, optionId: string): Promise<void>;
1216
1222
  /**
@@ -1531,7 +1537,7 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
1531
1537
  *
1532
1538
  * @method ch
1533
1539
  * @param chatId The identifier of the channel or supergroup to add the users to.
1534
- * @param userId The identifiers of the users to add to the channel or supergroup.
1540
+ * @param userIds The identifiers of the users to add to the channel or supergroup.
1535
1541
  * @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
1536
1542
  */
1537
1543
  addChatMembers(chatId: ID, userIds: ID[]): Promise<FailedInvitation[]>;
@@ -1911,6 +1917,20 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
1911
1917
  * @param reason The reason of the report.
1912
1918
  */
1913
1919
  reportChat(chatId: ID, reason: ReportReason, params?: ReportChatParams): Promise<void>;
1920
+ /**
1921
+ * Mark a chat as unread. User-only.
1922
+ *
1923
+ * @method ch
1924
+ * @param chatId The identifier of a chat.
1925
+ */
1926
+ markChatAsUnread(chatId: ID): Promise<void>;
1927
+ /**
1928
+ * Mark a chat as read. User-only.
1929
+ *
1930
+ * @method ch
1931
+ * @param chatId The identifier of a chat.
1932
+ */
1933
+ markChatAsRead(chatId: ID): Promise<void>;
1914
1934
  /**
1915
1935
  * Send a callback query. User-only.
1916
1936
  *
@@ -2490,7 +2510,7 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
2490
2510
  * @method gc
2491
2511
  * @param chatId The identifier of the chat that includes the gift collection.
2492
2512
  * @param collectionId The identifier of a gift collection.
2493
- * @param gifts The gifts to remove from the collection.
2513
+ * @param gifts The new order of gifts.
2494
2514
  */
2495
2515
  reorderGiftsInCollection(chatId: ID, collectionId: number, gifts: InputGift[]): Promise<GiftCollection>;
2496
2516
  /**
@@ -2528,7 +2548,7 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
2528
2548
  * @method ss
2529
2549
  * @param slug The slug of the sticker set or its link.
2530
2550
  */
2531
- getStickerSet(name: string): Promise<StickerSet>;
2551
+ getStickerSet(slug: string): Promise<StickerSet>;
2532
2552
  /**
2533
2553
  * Get a dice sticker set.
2534
2554
  *
@@ -2614,7 +2634,7 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
2614
2634
  * @param fileId The identifier of the sticker.
2615
2635
  * @param position The new position of the sticker.
2616
2636
  */
2617
- changeStickerPositionInStickerSet(slug: string, position: number): Promise<void>;
2637
+ changeStickerPositionInStickerSet(fileId: string, position: number): Promise<void>;
2618
2638
  /**
2619
2639
  * Set a sticker set's thumbnail.
2620
2640
  *
@@ -2670,5 +2690,56 @@ export declare class ClientDispatcher<C extends Context = Context> extends Compo
2670
2690
  * @returns The identifier of the sent message.
2671
2691
  */
2672
2692
  answerGuestQuery(id: string, result: InlineQueryResult): Promise<string>;
2693
+ /**
2694
+ * Request a secret chat. User-only.
2695
+ *
2696
+ * @method sc
2697
+ * @param chatId The identifier of a chat.
2698
+ */
2699
+ requestSecretChat(chatId: ID): Promise<SecretChat>;
2700
+ /**
2701
+ * Accept a secret chat. User-only.
2702
+ *
2703
+ * @method sc
2704
+ * @param id The identifier of the secret chat.
2705
+ */
2706
+ acceptSecretChat(id: number): Promise<SecretChat>;
2707
+ /**
2708
+ * Send a message to a secret chat. User-only.
2709
+ *
2710
+ * @method sc
2711
+ * @param id The identifier of the secret chat.
2712
+ * @param text The message's text.
2713
+ */
2714
+ sendSecretMessage(id: number, text: string, params?: SendSecretMessageParams): Promise<void>;
2715
+ /**
2716
+ * Send a location to a secret chat. User-only.
2717
+ *
2718
+ * @method sc
2719
+ * @param id The identifier of the secret chat.
2720
+ * @param latitude The location's latitude.
2721
+ * @param longitude The location's longitude.
2722
+ */
2723
+ sendSecretLocation(id: number, latitude: number, longitude: number, params?: SendSecretLocationParams): Promise<void>;
2724
+ /**
2725
+ * Send a venue to a secret chat. User-only.
2726
+ *
2727
+ * @method sc
2728
+ * @param id The identifier of the secret chat.
2729
+ * @param latitude The latitude of the venue.
2730
+ * @param longitude The longitude of the venue.
2731
+ * @param title The title of the venue.
2732
+ * @param address The written address of the venue.
2733
+ */
2734
+ sendSecretVenue(id: number, latitude: number, longitude: number, title: string, address: string, params?: SendSecretVenueParams): Promise<void>;
2735
+ /**
2736
+ * Send a contact to a secret chat. User-only.
2737
+ *
2738
+ * @method sc
2739
+ * @param id The identifier of the secret chat.
2740
+ * @param firstName The contact's first name.
2741
+ * @param phoneNumber The contact's phone number.
2742
+ */
2743
+ sendSecretContact(id: number, firstName: string, phoneNumber: string, params?: SendSecretContactParams): Promise<void>;
2673
2744
  }
2674
2745
  //# sourceMappingURL=6_client_dispatcher.d.ts.map