@mtkruto/node 0.137.0 → 0.139.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 (295) hide show
  1. package/esm/3_types.d.ts +2 -3
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +2 -3
  4. package/esm/client/0_markdown.d.ts.map +1 -1
  5. package/esm/client/0_markdown.js +1 -3
  6. package/esm/client/0_params.d.ts +6 -0
  7. package/esm/client/0_params.d.ts.map +1 -1
  8. package/esm/client/1_client_generic.d.ts +14 -9
  9. package/esm/client/1_client_generic.d.ts.map +1 -1
  10. package/esm/client/1_client_generic.js +1 -3
  11. package/esm/client/1_client_plain.d.ts +2 -6
  12. package/esm/client/1_client_plain.d.ts.map +1 -1
  13. package/esm/client/1_client_plain.js +1 -3
  14. package/esm/client/1_types.d.ts +1 -0
  15. package/esm/client/1_types.d.ts.map +1 -1
  16. package/esm/client/2_bot_info_manager.js +1 -1
  17. package/esm/client/2_business_connection_manager.js +1 -1
  18. package/esm/client/2_file_manager.d.ts.map +1 -1
  19. package/esm/client/2_file_manager.js +2 -0
  20. package/esm/client/2_payment_manager.js +1 -1
  21. package/esm/client/2_reaction_manager.js +4 -4
  22. package/esm/client/2_story_album_manager.d.ts.map +1 -1
  23. package/esm/client/2_story_album_manager.js +1 -2
  24. package/esm/client/2_translations_manager.js +2 -2
  25. package/esm/client/2_update_manager.js +1 -1
  26. package/esm/client/3_account_manager.d.ts +2 -1
  27. package/esm/client/3_account_manager.d.ts.map +1 -1
  28. package/esm/client/3_account_manager.js +11 -4
  29. package/esm/client/3_filters.d.ts +94 -18
  30. package/esm/client/3_filters.d.ts.map +1 -1
  31. package/esm/client/3_message_manager.d.ts.map +1 -1
  32. package/esm/client/3_message_manager.js +16 -19
  33. package/esm/client/3_video_chat_manager.js +1 -1
  34. package/esm/client/4_callback_query_manager.js +1 -1
  35. package/esm/client/4_chat_manager.d.ts.map +1 -1
  36. package/esm/client/4_chat_manager.js +4 -5
  37. package/esm/client/4_context.d.ts +154 -462
  38. package/esm/client/4_context.d.ts.map +1 -1
  39. package/esm/client/4_context.js +220 -505
  40. package/esm/client/4_inline_query_manager.js +3 -3
  41. package/esm/client/4_link_preview_manager.js +1 -1
  42. package/esm/client/4_poll_manager.js +2 -2
  43. package/esm/client/4_story_manager.js +5 -5
  44. package/esm/client/6_client.d.ts +13 -14
  45. package/esm/client/6_client.d.ts.map +1 -1
  46. package/esm/client/6_client.js +26 -14
  47. package/esm/client/6_client_dispatcher.d.ts +14 -9
  48. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  49. package/esm/client/6_client_dispatcher.js +15 -6
  50. package/esm/session/1_session.d.ts +2 -6
  51. package/esm/session/1_session.d.ts.map +1 -1
  52. package/esm/types/0_bot_token_check_result.d.ts +0 -1
  53. package/esm/types/0_bot_token_check_result.d.ts.map +1 -1
  54. package/esm/types/0_callback_query_question.d.ts +0 -3
  55. package/esm/types/0_callback_query_question.d.ts.map +1 -1
  56. package/esm/types/0_chat_action_type.d.ts +0 -13
  57. package/esm/types/0_chat_action_type.d.ts.map +1 -1
  58. package/esm/types/0_code_check_result.d.ts +0 -3
  59. package/esm/types/0_code_check_result.d.ts.map +1 -1
  60. package/esm/types/0_emoji_status.d.ts +0 -2
  61. package/esm/types/0_emoji_status.d.ts.map +1 -1
  62. package/esm/types/0_gift_component_rarity.d.ts +0 -5
  63. package/esm/types/0_gift_component_rarity.d.ts.map +1 -1
  64. package/esm/types/0_id.d.ts +1 -3
  65. package/esm/types/0_id.d.ts.map +1 -1
  66. package/{script/types/1_inline_query_result_button.d.ts → esm/types/0_inline_query_result_button.d.ts} +3 -4
  67. package/esm/types/0_inline_query_result_button.d.ts.map +1 -0
  68. package/esm/types/0_input_emoji_status.d.ts +0 -2
  69. package/esm/types/0_input_emoji_status.d.ts.map +1 -1
  70. package/esm/types/0_password_check_result.d.ts +0 -2
  71. package/esm/types/0_password_check_result.d.ts.map +1 -1
  72. package/esm/types/0_reaction.d.ts +0 -3
  73. package/esm/types/0_reaction.d.ts.map +1 -1
  74. package/esm/types/0_user_status.d.ts +0 -5
  75. package/esm/types/0_user_status.d.ts.map +1 -1
  76. package/esm/types/0_video_chat.d.ts +0 -3
  77. package/esm/types/0_video_chat.d.ts.map +1 -1
  78. package/esm/types/1_available_reactions.d.ts +0 -3
  79. package/esm/types/1_available_reactions.d.ts.map +1 -1
  80. package/esm/types/1_bot_command_scope.d.ts +0 -7
  81. package/esm/types/1_bot_command_scope.d.ts.map +1 -1
  82. package/esm/types/1_chat_p.d.ts +1 -7
  83. package/esm/types/1_chat_p.d.ts.map +1 -1
  84. package/esm/types/1_inline_keyboard_button.d.ts +25 -42
  85. package/esm/types/1_inline_keyboard_button.d.ts.map +1 -1
  86. package/esm/types/1_inline_keyboard_button.js +57 -64
  87. package/esm/types/1_input_gift.d.ts +0 -3
  88. package/esm/types/1_input_gift.d.ts.map +1 -1
  89. package/esm/types/1_input_story_content.d.ts +2 -2
  90. package/esm/types/1_input_story_content.d.ts.map +1 -1
  91. package/esm/types/1_keyboard_button.d.ts +33 -34
  92. package/esm/types/1_keyboard_button.d.ts.map +1 -1
  93. package/esm/types/1_keyboard_button.js +81 -88
  94. package/esm/types/2_chat.d.ts +1 -3
  95. package/esm/types/2_chat.d.ts.map +1 -1
  96. package/esm/types/2_chat_member.d.ts +6 -24
  97. package/esm/types/2_chat_member.d.ts.map +1 -1
  98. package/esm/types/2_message_entity.d.ts +0 -20
  99. package/esm/types/2_message_entity.d.ts.map +1 -1
  100. package/esm/types/{0_mini_app_button_info.js → 2_profile_photo_list.d.ts} +10 -2
  101. package/esm/types/2_profile_photo_list.d.ts.map +1 -0
  102. package/esm/types/{0_keyboard_button_poll_type.d.ts → 2_profile_photo_list.js} +6 -5
  103. package/esm/types/2_reply_markup.d.ts +4 -12
  104. package/esm/types/2_reply_markup.d.ts.map +1 -1
  105. package/esm/types/2_reply_markup.js +13 -17
  106. package/esm/types/2_star_transaction_peer.d.ts +0 -8
  107. package/esm/types/2_star_transaction_peer.d.ts.map +1 -1
  108. package/esm/types/2_story_album_icon.d.ts +0 -2
  109. package/esm/types/2_story_album_icon.d.ts.map +1 -1
  110. package/esm/types/2_story_content.d.ts +3 -4
  111. package/esm/types/2_story_content.d.ts.map +1 -1
  112. package/esm/types/2_story_content.js +3 -3
  113. package/esm/types/2_story_privacy.d.ts +6 -7
  114. package/esm/types/2_story_privacy.d.ts.map +1 -1
  115. package/esm/types/2_story_privacy.js +23 -20
  116. package/esm/types/3_checklist_item.d.ts +2 -8
  117. package/esm/types/3_checklist_item.d.ts.map +1 -1
  118. package/esm/types/3_forward_header.d.ts +0 -5
  119. package/esm/types/3_forward_header.d.ts.map +1 -1
  120. package/esm/types/3_gift_upgraded_component.d.ts +0 -4
  121. package/esm/types/3_gift_upgraded_component.d.ts.map +1 -1
  122. package/esm/types/3_input_media.d.ts +10 -20
  123. package/esm/types/3_input_media.d.ts.map +1 -1
  124. package/esm/types/4_gift.d.ts +0 -2
  125. package/esm/types/4_gift.d.ts.map +1 -1
  126. package/esm/types/4_reply_to.d.ts +6 -14
  127. package/esm/types/4_reply_to.d.ts.map +1 -1
  128. package/esm/types/5_link_preview.d.ts +2 -18
  129. package/esm/types/5_link_preview.d.ts.map +1 -1
  130. package/esm/types/6_message.d.ts +90 -179
  131. package/esm/types/6_message.d.ts.map +1 -1
  132. package/esm/types/6_message.js +104 -120
  133. package/esm/types/6_message_content.d.ts +0 -5
  134. package/esm/types/6_message_content.d.ts.map +1 -1
  135. package/esm/types/7_inline_query_result.d.ts +10 -47
  136. package/esm/types/7_inline_query_result.d.ts.map +1 -1
  137. package/esm/types/7_inline_query_result.js +219 -152
  138. package/esm/types/8_update.d.ts +58 -105
  139. package/esm/types/8_update.d.ts.map +1 -1
  140. package/esm/utilities/0_int.d.ts +1 -3
  141. package/esm/utilities/0_int.d.ts.map +1 -1
  142. package/package.json +1 -1
  143. package/script/3_types.d.ts +2 -3
  144. package/script/3_types.d.ts.map +1 -1
  145. package/script/3_types.js +2 -3
  146. package/script/client/0_markdown.d.ts.map +1 -1
  147. package/script/client/0_markdown.js +1 -3
  148. package/script/client/0_params.d.ts +6 -0
  149. package/script/client/0_params.d.ts.map +1 -1
  150. package/script/client/1_client_generic.d.ts +14 -9
  151. package/script/client/1_client_generic.d.ts.map +1 -1
  152. package/script/client/1_client_generic.js +1 -3
  153. package/script/client/1_client_plain.d.ts +2 -6
  154. package/script/client/1_client_plain.d.ts.map +1 -1
  155. package/script/client/1_client_plain.js +1 -3
  156. package/script/client/1_types.d.ts +1 -0
  157. package/script/client/1_types.d.ts.map +1 -1
  158. package/script/client/2_bot_info_manager.js +1 -1
  159. package/script/client/2_business_connection_manager.js +1 -1
  160. package/script/client/2_file_manager.d.ts.map +1 -1
  161. package/script/client/2_file_manager.js +2 -0
  162. package/script/client/2_payment_manager.js +1 -1
  163. package/script/client/2_reaction_manager.js +4 -4
  164. package/script/client/2_story_album_manager.d.ts.map +1 -1
  165. package/script/client/2_story_album_manager.js +1 -2
  166. package/script/client/2_translations_manager.js +2 -2
  167. package/script/client/2_update_manager.js +1 -1
  168. package/script/client/3_account_manager.d.ts +2 -1
  169. package/script/client/3_account_manager.d.ts.map +1 -1
  170. package/script/client/3_account_manager.js +9 -2
  171. package/script/client/3_filters.d.ts +94 -18
  172. package/script/client/3_filters.d.ts.map +1 -1
  173. package/script/client/3_message_manager.d.ts.map +1 -1
  174. package/script/client/3_message_manager.js +15 -18
  175. package/script/client/3_video_chat_manager.js +1 -1
  176. package/script/client/4_callback_query_manager.js +1 -1
  177. package/script/client/4_chat_manager.d.ts.map +1 -1
  178. package/script/client/4_chat_manager.js +4 -5
  179. package/script/client/4_context.d.ts +154 -462
  180. package/script/client/4_context.d.ts.map +1 -1
  181. package/script/client/4_context.js +220 -505
  182. package/script/client/4_inline_query_manager.js +3 -3
  183. package/script/client/4_link_preview_manager.js +1 -1
  184. package/script/client/4_poll_manager.js +2 -2
  185. package/script/client/4_story_manager.js +5 -5
  186. package/script/client/6_client.d.ts +13 -14
  187. package/script/client/6_client.d.ts.map +1 -1
  188. package/script/client/6_client.js +25 -13
  189. package/script/client/6_client_dispatcher.d.ts +14 -9
  190. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  191. package/script/client/6_client_dispatcher.js +15 -6
  192. package/script/session/1_session.d.ts +2 -6
  193. package/script/session/1_session.d.ts.map +1 -1
  194. package/script/types/0_bot_token_check_result.d.ts +0 -1
  195. package/script/types/0_bot_token_check_result.d.ts.map +1 -1
  196. package/script/types/0_callback_query_question.d.ts +0 -3
  197. package/script/types/0_callback_query_question.d.ts.map +1 -1
  198. package/script/types/0_chat_action_type.d.ts +0 -13
  199. package/script/types/0_chat_action_type.d.ts.map +1 -1
  200. package/script/types/0_code_check_result.d.ts +0 -3
  201. package/script/types/0_code_check_result.d.ts.map +1 -1
  202. package/script/types/0_emoji_status.d.ts +0 -2
  203. package/script/types/0_emoji_status.d.ts.map +1 -1
  204. package/script/types/0_gift_component_rarity.d.ts +0 -5
  205. package/script/types/0_gift_component_rarity.d.ts.map +1 -1
  206. package/script/types/0_id.d.ts +1 -3
  207. package/script/types/0_id.d.ts.map +1 -1
  208. package/{esm/types/1_inline_query_result_button.d.ts → script/types/0_inline_query_result_button.d.ts} +3 -4
  209. package/script/types/0_inline_query_result_button.d.ts.map +1 -0
  210. package/script/types/0_input_emoji_status.d.ts +0 -2
  211. package/script/types/0_input_emoji_status.d.ts.map +1 -1
  212. package/script/types/0_password_check_result.d.ts +0 -2
  213. package/script/types/0_password_check_result.d.ts.map +1 -1
  214. package/script/types/0_reaction.d.ts +0 -3
  215. package/script/types/0_reaction.d.ts.map +1 -1
  216. package/script/types/0_user_status.d.ts +0 -5
  217. package/script/types/0_user_status.d.ts.map +1 -1
  218. package/script/types/0_video_chat.d.ts +0 -3
  219. package/script/types/0_video_chat.d.ts.map +1 -1
  220. package/script/types/1_available_reactions.d.ts +0 -3
  221. package/script/types/1_available_reactions.d.ts.map +1 -1
  222. package/script/types/1_bot_command_scope.d.ts +0 -7
  223. package/script/types/1_bot_command_scope.d.ts.map +1 -1
  224. package/script/types/1_chat_p.d.ts +1 -7
  225. package/script/types/1_chat_p.d.ts.map +1 -1
  226. package/script/types/1_inline_keyboard_button.d.ts +25 -42
  227. package/script/types/1_inline_keyboard_button.d.ts.map +1 -1
  228. package/script/types/1_inline_keyboard_button.js +57 -64
  229. package/script/types/1_input_gift.d.ts +0 -3
  230. package/script/types/1_input_gift.d.ts.map +1 -1
  231. package/script/types/1_input_story_content.d.ts +2 -2
  232. package/script/types/1_input_story_content.d.ts.map +1 -1
  233. package/script/types/1_keyboard_button.d.ts +33 -34
  234. package/script/types/1_keyboard_button.d.ts.map +1 -1
  235. package/script/types/1_keyboard_button.js +81 -88
  236. package/script/types/2_chat.d.ts +1 -3
  237. package/script/types/2_chat.d.ts.map +1 -1
  238. package/script/types/2_chat_member.d.ts +6 -24
  239. package/script/types/2_chat_member.d.ts.map +1 -1
  240. package/script/types/2_message_entity.d.ts +0 -20
  241. package/script/types/2_message_entity.d.ts.map +1 -1
  242. package/script/types/{0_keyboard_button_poll_type.d.ts → 2_profile_photo_list.d.ts} +10 -5
  243. package/script/types/2_profile_photo_list.d.ts.map +1 -0
  244. package/script/types/{0_mini_app_button_info.js → 2_profile_photo_list.js} +7 -3
  245. package/script/types/2_reply_markup.d.ts +4 -12
  246. package/script/types/2_reply_markup.d.ts.map +1 -1
  247. package/script/types/2_reply_markup.js +13 -17
  248. package/script/types/2_star_transaction_peer.d.ts +0 -8
  249. package/script/types/2_star_transaction_peer.d.ts.map +1 -1
  250. package/script/types/2_story_album_icon.d.ts +0 -2
  251. package/script/types/2_story_album_icon.d.ts.map +1 -1
  252. package/script/types/2_story_content.d.ts +3 -4
  253. package/script/types/2_story_content.d.ts.map +1 -1
  254. package/script/types/2_story_content.js +3 -3
  255. package/script/types/2_story_privacy.d.ts +6 -7
  256. package/script/types/2_story_privacy.d.ts.map +1 -1
  257. package/script/types/2_story_privacy.js +23 -20
  258. package/script/types/3_checklist_item.d.ts +2 -8
  259. package/script/types/3_checklist_item.d.ts.map +1 -1
  260. package/script/types/3_forward_header.d.ts +0 -5
  261. package/script/types/3_forward_header.d.ts.map +1 -1
  262. package/script/types/3_gift_upgraded_component.d.ts +0 -4
  263. package/script/types/3_gift_upgraded_component.d.ts.map +1 -1
  264. package/script/types/3_input_media.d.ts +10 -20
  265. package/script/types/3_input_media.d.ts.map +1 -1
  266. package/script/types/4_gift.d.ts +0 -2
  267. package/script/types/4_gift.d.ts.map +1 -1
  268. package/script/types/4_reply_to.d.ts +6 -14
  269. package/script/types/4_reply_to.d.ts.map +1 -1
  270. package/script/types/5_link_preview.d.ts +2 -18
  271. package/script/types/5_link_preview.d.ts.map +1 -1
  272. package/script/types/6_message.d.ts +90 -179
  273. package/script/types/6_message.d.ts.map +1 -1
  274. package/script/types/6_message.js +105 -121
  275. package/script/types/6_message_content.d.ts +0 -5
  276. package/script/types/6_message_content.d.ts.map +1 -1
  277. package/script/types/7_inline_query_result.d.ts +10 -47
  278. package/script/types/7_inline_query_result.d.ts.map +1 -1
  279. package/script/types/7_inline_query_result.js +219 -152
  280. package/script/types/8_update.d.ts +58 -105
  281. package/script/types/8_update.d.ts.map +1 -1
  282. package/script/utilities/0_int.d.ts +1 -3
  283. package/script/utilities/0_int.d.ts.map +1 -1
  284. package/esm/types/0_keyboard_button_poll_type.d.ts.map +0 -1
  285. package/esm/types/0_mini_app_button_info.d.ts +0 -26
  286. package/esm/types/0_mini_app_button_info.d.ts.map +0 -1
  287. package/esm/types/1_inline_query_result_button.d.ts.map +0 -1
  288. package/esm/types/1_inline_query_result_button.js +0 -20
  289. package/script/types/0_keyboard_button_poll_type.d.ts.map +0 -1
  290. package/script/types/0_mini_app_button_info.d.ts +0 -26
  291. package/script/types/0_mini_app_button_info.d.ts.map +0 -1
  292. package/script/types/1_inline_query_result_button.d.ts.map +0 -1
  293. package/script/types/1_inline_query_result_button.js +0 -21
  294. /package/esm/types/{0_keyboard_button_poll_type.js → 0_inline_query_result_button.js} +0 -0
  295. /package/script/types/{0_keyboard_button_poll_type.js → 0_inline_query_result_button.js} +0 -0
@@ -225,66 +225,89 @@ export class Context {
225
225
  unreachable();
226
226
  }
227
227
  #getReplyTo = (isQuoted, chatId, messageId) => {
228
- if ("story" in this.update) {
229
- return { replyTo: { chatId: this.update.story.chat.id, storyId: this.update.story.id } };
228
+ if (this.update.type === "story") {
229
+ return { replyTo: { type: "story", chatId: this.update.story.chat.id, storyId: this.update.story.id } };
230
230
  }
231
231
  let messageThreadId = undefined;
232
- if ("message" in this.update) {
233
- messageThreadId = this.update.message.threadId;
234
- }
235
- else if ("editedMessage" in this.update) {
236
- messageThreadId = this.update.editedMessage.threadId;
237
- }
238
- else if ("scheduledMessage" in this.update) {
239
- messageThreadId = this.update.scheduledMessage.threadId;
232
+ switch (this.update.type) {
233
+ case "message":
234
+ messageThreadId = this.update.message.threadId;
235
+ break;
236
+ case "editedMessage":
237
+ messageThreadId = this.update.editedMessage.threadId;
238
+ break;
239
+ case "scheduledMessage":
240
+ messageThreadId = this.update.scheduledMessage.threadId;
241
+ break;
240
242
  }
241
243
  const isPrivate = chatId > 0;
242
244
  const shouldQuote = isQuoted === undefined ? !isPrivate : isQuoted;
243
- return { messageThreadId, replyTo: shouldQuote ? { messageId } : undefined };
245
+ return { messageThreadId, replyTo: shouldQuote ? { type: "message", messageId } : undefined };
244
246
  };
245
247
  get chat() {
246
248
  if (this.msg !== undefined) {
247
249
  return this.msg.chat;
248
250
  }
249
- return "messageReactions" in this.update
250
- //
251
- ? this.update.messageReactions.chat
252
- : "messageReactionCount" in this.update
253
- ? this.update.messageReactionCount.chat
254
- : "chatMember" in this.update
255
- ? this.update.chatMember.chat
256
- : "myChatMember" in this.update
257
- ? this.update.myChatMember.chat
258
- : "joinRequest" in this.update
259
- ? this.update.joinRequest.chat
260
- : "story" in this.update
261
- ? this.update.story.chat
262
- : "newChat" in this.update
263
- ? this.update.newChat.chat
264
- : "editedChat" in this.update
265
- ? this.update.editedChat.chat
266
- : undefined;
251
+ switch (this.update.type) {
252
+ case "messageReactions":
253
+ return this.update.messageReactions.chat;
254
+ case "messageReactionCount":
255
+ return this.update.messageReactionCount.chat;
256
+ case "chatMember":
257
+ return this.update.chatMember.chat;
258
+ case "myChatMember":
259
+ return this.update.myChatMember.chat;
260
+ case "joinRequest":
261
+ return this.update.joinRequest.chat;
262
+ case "story":
263
+ return this.update.story.chat;
264
+ case "newChat":
265
+ return this.update.newChat.chat;
266
+ case "editedChat":
267
+ return this.update.editedChat.chat;
268
+ }
269
+ return undefined;
267
270
  }
268
271
  get chatId() {
269
272
  if (this.chat !== undefined) {
270
273
  return this.chat.id;
271
274
  }
272
- return "deletedStory" in this.update
273
- //
274
- ? this.update.deletedStory.chatId
275
- : "messageInteractions" in this.update
276
- ? this.update.messageInteractions.chatId
277
- : "deletedChat" in this.update
278
- ? this.update.deletedChat.chatId
279
- : "botCommands" in this.update
280
- ? this.update.botCommands.chatId
281
- : "chatAction" in this.update
282
- ? this.update.chatAction.chatId
283
- : undefined;
275
+ switch (this.update.type) {
276
+ case "deletedStory":
277
+ return this.update.deletedStory.chatId;
278
+ case "messageInteractions":
279
+ return this.update.messageInteractions.chatId;
280
+ case "deletedChat":
281
+ return this.update.deletedChat.chatId;
282
+ case "botCommands":
283
+ return this.update.botCommands.chatId;
284
+ case "chatAction":
285
+ return this.update.chatAction.chatId;
286
+ }
287
+ return undefined;
284
288
  }
285
289
  get from() {
286
- const from = "callbackQuery" in this.update ? this.update.callbackQuery.from : "inlineQuery" in this.update ? this.update.inlineQuery.from : "chatMember" in this.update ? this.update.chatMember.from : "myChatMember" in this.update ? this.update.myChatMember.from : "messageReactions" in this.update ? this.update.messageReactions.user : "preCheckoutQuery" in this.update ? this.update.preCheckoutQuery.from : "joinRequest" in this.update ? this.update.joinRequest.from : "businessConnection" in this.update ? this.update.businessConnection.user : "pollAnswer" in this.update ? this.update.pollAnswer.from : this.msg?.from;
287
- return from;
290
+ switch (this.update.type) {
291
+ case "callbackQuery":
292
+ return this.update.callbackQuery.from;
293
+ case "inlineQuery":
294
+ return this.update.inlineQuery.from;
295
+ case "chatMember":
296
+ return this.update.chatMember.from;
297
+ case "myChatMember":
298
+ return this.update.myChatMember.from;
299
+ case "messageReactions":
300
+ return this.update.messageReactions.user;
301
+ case "preCheckoutQuery":
302
+ return this.update.preCheckoutQuery.from;
303
+ case "joinRequest":
304
+ return this.update.joinRequest.from;
305
+ case "businessConnection":
306
+ return this.update.businessConnection.user;
307
+ case "pollAnswer":
308
+ return this.update.pollAnswer.from;
309
+ }
310
+ return this.msg?.from;
288
311
  }
289
312
  hasFilterQuery(filter) {
290
313
  return Context.has.filterQuery(filter)(this);
@@ -317,85 +340,63 @@ export class Context {
317
340
  return this.update;
318
341
  }
319
342
  }
320
- /**
321
- * Context-aware alias for {@link Client.addContact}.
322
- */
343
+ /** Context-aware alias for {@link Client.addContact}. */
323
344
  async addAsContact(firstName, params) {
324
345
  const chatId = this.#mustGetChatId();
325
346
  return await this.client.addContact(chatId, firstName, params);
326
347
  }
327
- /**
328
- * Context-aware alias for {@link Client.addChatMember}.
329
- */
348
+ /** Context-aware alias for {@link Client.addChatMember}. */
330
349
  async addMember(userId, params) {
331
350
  const chatId = this.#mustGetChatId();
332
351
  return await this.client.addChatMember(chatId, userId, params);
333
352
  }
334
- /**
335
- * Context-aware alias for {@link Client.addChatMembers}.
336
- */
353
+ /** Context-aware alias for {@link Client.addChatMembers}. */
337
354
  async addMembers(userIds) {
338
355
  const chatId = this.#mustGetChatId();
339
356
  return await this.client.addChatMembers(chatId, userIds);
340
357
  }
341
- /**
342
- * Context-aware alias for {@link Client.addReaction}.
343
- */
358
+ /** Context-aware alias for {@link Client.addReaction}. */
344
359
  async addReaction(messageId, reaction, params) {
345
360
  const chatId = this.#mustGetChatId();
346
361
  return await this.client.addReaction(chatId, messageId, reaction, params);
347
362
  }
348
- /**
349
- * Context-aware alias for {@link Client.addStoriesToHighlights}.
350
- */
363
+ /** Context-aware alias for {@link Client.addStoriesToHighlights}. */
351
364
  async addStoriesToHighlights(storyIds) {
352
365
  const chatId = this.#mustGetChatId();
353
366
  return await this.client.addStoriesToHighlights(chatId, storyIds);
354
367
  }
355
- /**
356
- * Context-aware alias for {@link Client.addStoryToHighlights}.
357
- */
368
+ /** Context-aware alias for {@link Client.addStoryToHighlights}. */
358
369
  async addStoryToHighlights(storyId) {
359
370
  const chatId = this.#mustGetChatId();
360
371
  return await this.client.addStoryToHighlights(chatId, storyId);
361
372
  }
362
- /**
363
- * Context-aware alias for {@link Client.addToChecklist}.
364
- */
373
+ /** Context-aware alias for {@link Client.addToChecklist}. */
365
374
  async addToChecklist(messageId, items) {
366
375
  const chatId = this.#mustGetChatId();
367
376
  return await this.client.addToChecklist(chatId, messageId, items);
368
377
  }
369
- /**
370
- * Context-aware alias for {@link Client.answerCallbackQuery}.
371
- */
378
+ /** Context-aware alias for {@link Client.answerCallbackQuery}. */
372
379
  async answerCallbackQuery(params) {
373
380
  if (!("callbackQuery" in this.update)) {
374
381
  unreachable();
375
382
  }
376
383
  return await this.client.answerCallbackQuery(this.update.callbackQuery.id, params);
377
384
  }
378
- /**
379
- * Context-aware alias for {@link Client.answerInlineQuery}.
380
- */
385
+ /** Context-aware alias for {@link Client.answerInlineQuery}. */
381
386
  async answerInlineQuery(results, params) {
382
387
  if (!("inlineQuery" in this.update)) {
383
388
  unreachable();
384
389
  }
385
390
  return await this.client.answerInlineQuery(this.update.inlineQuery.id, results, params);
386
391
  }
387
- /**
388
- * Context-aware alias for {@link Client.answerPreCheckoutQuery}.
389
- */
392
+ /** Context-aware alias for {@link Client.answerPreCheckoutQuery}. */
390
393
  async answerPreCheckoutQuery(ok, params) {
391
394
  if (!("preCheckoutQuery" in this.update)) {
392
395
  unreachable();
393
396
  }
394
397
  return await this.client.answerPreCheckoutQuery(this.update.preCheckoutQuery.id, ok, params);
395
398
  }
396
- /**
397
- * Context-aware alias for {@link Client.approveJoinRequest}.
398
- */
399
+ /** Context-aware alias for {@link Client.approveJoinRequest}. */
399
400
  async approveJoinRequest() {
400
401
  const { chatId, userId } = this.#mustGetMsg();
401
402
  if (!userId) {
@@ -403,30 +404,22 @@ export class Context {
403
404
  }
404
405
  return await this.client.approveJoinRequest(chatId, userId);
405
406
  }
406
- /**
407
- * Context-aware alias for {@link Client.approveJoinRequests}.
408
- */
407
+ /** Context-aware alias for {@link Client.approveJoinRequests}. */
409
408
  async approveJoinRequests(params) {
410
409
  const chatId = this.#mustGetChatId();
411
410
  return await this.client.approveJoinRequests(chatId, params);
412
411
  }
413
- /**
414
- * Context-aware alias for {@link Client.archiveChat}.
415
- */
412
+ /** Context-aware alias for {@link Client.archiveChat}. */
416
413
  async archive() {
417
414
  const chatId = this.#mustGetChatId();
418
415
  return await this.client.archiveChat(chatId);
419
416
  }
420
- /**
421
- * Context-aware alias for {@link Client.banChatMember}.
422
- */
417
+ /** Context-aware alias for {@link Client.banChatMember}. */
423
418
  async banChatMember(memberId, params) {
424
419
  const chatId = this.#mustGetChatId();
425
420
  return await this.client.banChatMember(chatId, memberId, params);
426
421
  }
427
- /**
428
- * Context-aware alias for {@link Client.banChatMember}.
429
- */
422
+ /** Context-aware alias for {@link Client.banChatMember}. */
430
423
  async banSender(params) {
431
424
  const { chatId, senderId } = this.#mustGetMsg();
432
425
  if (!senderId) {
@@ -434,64 +427,46 @@ export class Context {
434
427
  }
435
428
  return await this.client.banChatMember(chatId, senderId, params);
436
429
  }
437
- /**
438
- * Context-aware alias for {@link Client.blockUser}.
439
- */
430
+ /** Context-aware alias for {@link Client.blockUser}. */
440
431
  async blockUser() {
441
432
  return await this.client.blockUser(this.#mustGetUserId());
442
433
  }
443
- /**
444
- * Context-aware alias for {@link Client.checkChecklistItem}.
445
- */
434
+ /** Context-aware alias for {@link Client.checkChecklistItem}. */
446
435
  async checkChecklistItem(messageId, item) {
447
436
  const chatId = this.#mustGetChatId();
448
437
  return await this.client.checkChecklistItem(chatId, messageId, item);
449
438
  }
450
- /**
451
- * Context-aware alias for {@link Client.checkChecklistItems}.
452
- */
439
+ /** Context-aware alias for {@link Client.checkChecklistItems}. */
453
440
  async checkChecklistItems(messageId, items) {
454
441
  const chatId = this.#mustGetChatId();
455
442
  return await this.client.checkChecklistItems(chatId, messageId, items);
456
443
  }
457
- /**
458
- * Context-aware alias for {@link Client.closeChat}.
459
- */
444
+ /** Context-aware alias for {@link Client.closeChat}. */
460
445
  async close() {
461
446
  const chatId = this.#mustGetChatId();
462
447
  return await this.client.closeChat(chatId);
463
448
  }
464
- /**
465
- * Context-aware alias for {@link Client.closeTopic}.
466
- */
449
+ /** Context-aware alias for {@link Client.closeTopic}. */
467
450
  async closeTopic(topicId) {
468
451
  const chatId = this.#mustGetChatId();
469
452
  return await this.client.closeTopic(chatId, topicId);
470
453
  }
471
- /**
472
- * Context-aware alias for {@link Client.createInviteLink}.
473
- */
454
+ /** Context-aware alias for {@link Client.createInviteLink}. */
474
455
  async createInviteLink(params) {
475
456
  const chatId = this.#mustGetChatId();
476
457
  return await this.client.createInviteLink(chatId, params);
477
458
  }
478
- /**
479
- * Context-aware alias for {@link Client.createStory}.
480
- */
459
+ /** Context-aware alias for {@link Client.createStory}. */
481
460
  async createStory(content, params) {
482
461
  const chatId = this.#mustGetChatId();
483
462
  return await this.client.createStory(chatId, content, params);
484
463
  }
485
- /**
486
- * Context-aware alias for {@link Client.createTopic}.
487
- */
464
+ /** Context-aware alias for {@link Client.createTopic}. */
488
465
  async createTopic(title, params) {
489
466
  const chatId = this.#mustGetChatId();
490
467
  return await this.client.createTopic(chatId, title, params);
491
468
  }
492
- /**
493
- * Context-aware alias for {@link Client.declineJoinRequest}.
494
- */
469
+ /** Context-aware alias for {@link Client.declineJoinRequest}. */
495
470
  async declineJoinRequest() {
496
471
  const { chatId, userId } = this.#mustGetMsg();
497
472
  if (!userId) {
@@ -499,282 +474,202 @@ export class Context {
499
474
  }
500
475
  return await this.client.declineJoinRequest(chatId, userId);
501
476
  }
502
- /**
503
- * Context-aware alias for {@link Client.declineJoinRequests}.
504
- */
477
+ /** Context-aware alias for {@link Client.declineJoinRequests}. */
505
478
  async declineJoinRequests(params) {
506
479
  const chatId = this.#mustGetChatId();
507
480
  return await this.client.declineJoinRequests(chatId, params);
508
481
  }
509
- /**
510
- * Context-aware alias for {@link Client.deleteChatPhoto}.
511
- */
482
+ /** Context-aware alias for {@link Client.deleteChatPhoto}. */
512
483
  async deleteChatPhoto() {
513
484
  const chatId = this.#mustGetChatId();
514
485
  return await this.client.deleteChatPhoto(chatId);
515
486
  }
516
- /**
517
- * Context-aware alias for {@link Client.deleteMessage}.
518
- */
487
+ /** Context-aware alias for {@link Client.deleteMessage}. */
519
488
  async delete() {
520
489
  const { chatId, messageId } = this.#mustGetMsg();
521
490
  return await this.client.deleteMessage(chatId, messageId);
522
491
  }
523
- /**
524
- * Context-aware alias for {@link Client.deleteChat}.
525
- */
492
+ /** Context-aware alias for {@link Client.deleteChat}. */
526
493
  async deleteChat() {
527
494
  const chatId = this.#mustGetChatId();
528
495
  return await this.client.deleteChat(chatId);
529
496
  }
530
- /**
531
- * Context-aware alias for {@link Client.deleteChatMemberMessages}.
532
- */
497
+ /** Context-aware alias for {@link Client.deleteChatMemberMessages}. */
533
498
  async deleteChatMemberMessages(userId) {
534
499
  const chatId = this.#mustGetChatId();
535
500
  return await this.client.deleteChatMemberMessages(chatId, userId);
536
501
  }
537
- /**
538
- * Context-aware alias for {@link Client.deleteChatStickerSet}.
539
- */
502
+ /** Context-aware alias for {@link Client.deleteChatStickerSet}. */
540
503
  async deleteChatStickerSet() {
541
504
  const chatId = this.#mustGetChatId();
542
505
  return await this.client.deleteChatStickerSet(chatId);
543
506
  }
544
- /**
545
- * Context-aware alias for {@link Client.deleteMessage}.
546
- */
507
+ /** Context-aware alias for {@link Client.deleteMessage}. */
547
508
  async deleteMessage(messageId, params) {
548
509
  const chatId = this.#mustGetChatId();
549
510
  return await this.client.deleteMessage(chatId, messageId, params);
550
511
  }
551
- /**
552
- * Context-aware alias for {@link Client.deleteMessages}.
553
- */
512
+ /** Context-aware alias for {@link Client.deleteMessages}. */
554
513
  async deleteMessages(messageIds, params) {
555
514
  const chatId = this.#mustGetChatId();
556
515
  return await this.client.deleteMessages(chatId, messageIds, params);
557
516
  }
558
- /**
559
- * Context-aware alias for {@link Client.deleteScheduledMessage}.
560
- */
517
+ /** Context-aware alias for {@link Client.deleteScheduledMessage}. */
561
518
  async deleteScheduledMessage(messageId) {
562
519
  const chatId = this.#mustGetChatId();
563
520
  return await this.client.deleteScheduledMessage(chatId, messageId);
564
521
  }
565
- /**
566
- * Context-aware alias for {@link Client.deleteScheduledMessages}.
567
- */
522
+ /** Context-aware alias for {@link Client.deleteScheduledMessages}. */
568
523
  async deleteScheduledMessages(messageIds) {
569
524
  const chatId = this.#mustGetChatId();
570
525
  return await this.client.deleteScheduledMessages(chatId, messageIds);
571
526
  }
572
- /**
573
- * Context-aware alias for {@link Client.deleteStories}.
574
- */
527
+ /** Context-aware alias for {@link Client.deleteStories}. */
575
528
  async deleteStories(storyIds) {
576
529
  const chatId = this.#mustGetChatId();
577
530
  return await this.client.deleteStories(chatId, storyIds);
578
531
  }
579
- /**
580
- * Context-aware alias for {@link Client.deleteStory}.
581
- */
532
+ /** Context-aware alias for {@link Client.deleteStory}. */
582
533
  async deleteStory(storyId) {
583
534
  const chatId = this.#mustGetChatId();
584
535
  return await this.client.deleteStory(chatId, storyId);
585
536
  }
586
- /**
587
- * Context-aware alias for {@link Client.disableAntispam}.
588
- */
537
+ /** Context-aware alias for {@link Client.disableAntispam}. */
589
538
  async disableAntispam() {
590
539
  const chatId = this.#mustGetChatId();
591
540
  return await this.client.disableAntispam(chatId);
592
541
  }
593
- /**
594
- * Context-aware alias for {@link Client.disableBusinessBots}.
595
- */
542
+ /** Context-aware alias for {@link Client.disableBusinessBots}. */
596
543
  async disableBusinessBots() {
597
544
  const chatId = this.#mustGetChatId();
598
545
  return await this.client.disableBusinessBots(chatId);
599
546
  }
600
- /**
601
- * Context-aware alias for {@link Client.disableJoinRequests}.
602
- */
547
+ /** Context-aware alias for {@link Client.disableJoinRequests}. */
603
548
  async disableJoinRequests() {
604
549
  const chatId = this.#mustGetChatId();
605
550
  return await this.client.disableJoinRequests(chatId);
606
551
  }
607
- /**
608
- * Context-aware alias for {@link Client.disableSharing}.
609
- */
552
+ /** Context-aware alias for {@link Client.disableSharing}. */
610
553
  async disableSharing() {
611
554
  const chatId = this.#mustGetChatId();
612
555
  return await this.client.disableSharing(chatId);
613
556
  }
614
- /**
615
- * Context-aware alias for {@link Client.disableSignatures}.
616
- */
557
+ /** Context-aware alias for {@link Client.disableSignatures}. */
617
558
  async disableSignatures() {
618
559
  const chatId = this.#mustGetChatId();
619
560
  return await this.client.disableSignatures(chatId);
620
561
  }
621
- /**
622
- * Context-aware alias for {@link Client.disableSlowMode}.
623
- */
562
+ /** Context-aware alias for {@link Client.disableSlowMode}. */
624
563
  async disableSlowMode() {
625
564
  const chatId = this.#mustGetChatId();
626
565
  return await this.client.disableSlowMode(chatId);
627
566
  }
628
- /**
629
- * Context-aware alias for {@link Client.disableTopics}.
630
- */
567
+ /** Context-aware alias for {@link Client.disableTopics}. */
631
568
  async disableTopics() {
632
569
  const chatId = this.#mustGetChatId();
633
570
  return await this.client.disableTopics(chatId);
634
571
  }
635
- /**
636
- * Context-aware alias for {@link Client.editInlineMessageCaption}.
637
- */
572
+ /** Context-aware alias for {@link Client.editInlineMessageCaption}. */
638
573
  async editInlineMessageCaption(params) {
639
574
  const inlineMessageId = this.#mustGetInlineMsgId();
640
575
  return await this.client.editInlineMessageCaption(inlineMessageId, params);
641
576
  }
642
- /**
643
- * Context-aware alias for {@link Client.editInlineMessageLiveLocation}.
644
- */
577
+ /** Context-aware alias for {@link Client.editInlineMessageLiveLocation}. */
645
578
  async editInlineMessageLiveLocation(latitude, longitude, params) {
646
579
  const inlineMessageId = this.#mustGetInlineMsgId();
647
580
  return await this.client.editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params);
648
581
  }
649
- /**
650
- * Context-aware alias for {@link Client.editInlineMessageMedia}.
651
- */
582
+ /** Context-aware alias for {@link Client.editInlineMessageMedia}. */
652
583
  async editInlineMessageMedia(media, params) {
653
584
  const inlineMessageId = this.#mustGetInlineMsgId();
654
585
  return await this.client.editInlineMessageMedia(inlineMessageId, media, params);
655
586
  }
656
- /**
657
- * Context-aware alias for {@link Client.editInlineMessageReplyMarkup}.
658
- */
587
+ /** Context-aware alias for {@link Client.editInlineMessageReplyMarkup}. */
659
588
  async editInlineMessageReplyMarkup(params) {
660
589
  const inlineMessageId = this.#mustGetInlineMsgId();
661
590
  return await this.client.editInlineMessageReplyMarkup(inlineMessageId, params);
662
591
  }
663
- /**
664
- * Context-aware alias for {@link Client.editInlineMessageText}.
665
- */
592
+ /** Context-aware alias for {@link Client.editInlineMessageText}. */
666
593
  async editInlineMessageText(text, params) {
667
594
  const inlineMessageId = this.#mustGetInlineMsgId();
668
595
  return await this.client.editInlineMessageText(inlineMessageId, text, params);
669
596
  }
670
- /**
671
- * Context-aware alias for {@link Client.editMessageCaption}.
672
- */
597
+ /** Context-aware alias for {@link Client.editMessageCaption}. */
673
598
  async editMessageCaption(messageId, params) {
674
599
  const chatId = this.#mustGetChatId();
675
600
  return await this.client.editMessageCaption(chatId, messageId, params);
676
601
  }
677
- /**
678
- * Context-aware alias for {@link Client.editMessageLiveLocation}.
679
- */
602
+ /** Context-aware alias for {@link Client.editMessageLiveLocation}. */
680
603
  async editMessageLiveLocation(messageId, latitude, longitude, params) {
681
604
  const chatId = this.#mustGetChatId();
682
605
  return await this.client.editMessageLiveLocation(chatId, messageId, latitude, longitude, params);
683
606
  }
684
- /**
685
- * Context-aware alias for {@link Client.editMessageMedia}.
686
- */
607
+ /** Context-aware alias for {@link Client.editMessageMedia}. */
687
608
  async editMessageMedia(messageId, media, params) {
688
609
  const chatId = this.#mustGetChatId();
689
610
  return await this.client.editMessageMedia(chatId, messageId, media, params);
690
611
  }
691
- /**
692
- * Context-aware alias for {@link Client.editMessageReplyMarkup}.
693
- */
612
+ /** Context-aware alias for {@link Client.editMessageReplyMarkup}. */
694
613
  async editMessageReplyMarkup(messageId, params) {
695
614
  const chatId = this.#mustGetChatId();
696
615
  return await this.client.editMessageReplyMarkup(chatId, messageId, params);
697
616
  }
698
- /**
699
- * Context-aware alias for {@link Client.editMessageText}.
700
- */
617
+ /** Context-aware alias for {@link Client.editMessageText}. */
701
618
  async editMessageText(messageId, text, params) {
702
619
  const chatId = this.#mustGetChatId();
703
620
  return await this.client.editMessageText(chatId, messageId, text, params);
704
621
  }
705
- /**
706
- * Context-aware alias for {@link Client.editTopic}.
707
- */
622
+ /** Context-aware alias for {@link Client.editTopic}. */
708
623
  async editTopic(topicId, title, params) {
709
624
  const chatId = this.#mustGetChatId();
710
625
  return await this.client.editTopic(chatId, topicId, title, params);
711
626
  }
712
- /**
713
- * Context-aware alias for {@link Client.enableAntispam}.
714
- */
627
+ /** Context-aware alias for {@link Client.enableAntispam}. */
715
628
  async enableAntispam() {
716
629
  const chatId = this.#mustGetChatId();
717
630
  return await this.client.enableAntispam(chatId);
718
631
  }
719
- /**
720
- * Context-aware alias for {@link Client.enableBusinessBots}.
721
- */
632
+ /** Context-aware alias for {@link Client.enableBusinessBots}. */
722
633
  async enableBusinessBots() {
723
634
  const chatId = this.#mustGetChatId();
724
635
  return await this.client.enableBusinessBots(chatId);
725
636
  }
726
- /**
727
- * Context-aware alias for {@link Client.enableJoinRequests}.
728
- */
637
+ /** Context-aware alias for {@link Client.enableJoinRequests}. */
729
638
  async enableJoinRequests() {
730
639
  const chatId = this.#mustGetChatId();
731
640
  return await this.client.enableJoinRequests(chatId);
732
641
  }
733
- /**
734
- * Context-aware alias for {@link Client.enableSharing}.
735
- */
642
+ /** Context-aware alias for {@link Client.enableSharing}. */
736
643
  async enableSharing() {
737
644
  const chatId = this.#mustGetChatId();
738
645
  return await this.client.enableSharing(chatId);
739
646
  }
740
- /**
741
- * Context-aware alias for {@link Client.enableSignatures}.
742
- */
647
+ /** Context-aware alias for {@link Client.enableSignatures}. */
743
648
  async enableSignatures(params) {
744
649
  const chatId = this.#mustGetChatId();
745
650
  return await this.client.enableSignatures(chatId, params);
746
651
  }
747
- /**
748
- * Context-aware alias for {@link Client.enableTopics}.
749
- */
652
+ /** Context-aware alias for {@link Client.enableTopics}. */
750
653
  async enableTopics(isShownAsTabs) {
751
654
  const chatId = this.#mustGetChatId();
752
655
  return await this.client.enableTopics(chatId, isShownAsTabs);
753
656
  }
754
- /**
755
- * Context-aware alias for {@link Client.forwardMessage}.
756
- */
657
+ /** Context-aware alias for {@link Client.forwardMessage}. */
757
658
  async forward(to, params) {
758
659
  const { chatId, messageId } = this.#mustGetMsg();
759
660
  return await this.client.forwardMessage(chatId, to, messageId, params);
760
661
  }
761
- /**
762
- * Context-aware alias for {@link Client.forwardMessage}.
763
- */
662
+ /** Context-aware alias for {@link Client.forwardMessage}. */
764
663
  async forwardMessage(to, messageId, params) {
765
664
  const chatId = this.#mustGetChatId();
766
665
  return await this.client.forwardMessage(chatId, to, messageId, params);
767
666
  }
768
- /**
769
- * Context-aware alias for {@link Client.forwardMessages}.
770
- */
667
+ /** Context-aware alias for {@link Client.forwardMessages}. */
771
668
  async forwardMessages(to, messageIds, params) {
772
669
  const chatId = this.#mustGetChatId();
773
670
  return await this.client.forwardMessages(chatId, to, messageIds, params);
774
671
  }
775
- /**
776
- * Context-aware alias for {@link Client.getBusinessConnection}.
777
- */
672
+ /** Context-aware alias for {@link Client.getBusinessConnection}. */
778
673
  async getBusinessConnection() {
779
674
  const { businessConnectionId } = this.#mustGetMsg();
780
675
  if (!businessConnectionId) {
@@ -782,163 +677,117 @@ export class Context {
782
677
  }
783
678
  return await this.client.getBusinessConnection(businessConnectionId);
784
679
  }
785
- /**
786
- * Context-aware alias for {@link Client.getChat}.
787
- */
680
+ /** Context-aware alias for {@link Client.getChat}. */
788
681
  async getChat() {
789
682
  const chatId = this.#mustGetChatId();
790
683
  return await this.client.getChat(chatId);
791
684
  }
792
- /**
793
- * Context-aware alias for {@link Client.getChatAdministrators}.
794
- */
685
+ /** Context-aware alias for {@link Client.getChatAdministrators}. */
795
686
  async getChatAdministrators() {
796
687
  const chatId = this.#mustGetChatId();
797
688
  return await this.client.getChatAdministrators(chatId);
798
689
  }
799
- /**
800
- * Context-aware alias for {@link Client.getChatMember}.
801
- */
690
+ /** Context-aware alias for {@link Client.getChatMember}. */
802
691
  async getChatMember(userId) {
803
692
  const chatId = this.#mustGetChatId();
804
693
  return await this.client.getChatMember(chatId, userId);
805
694
  }
806
- /**
807
- * Context-aware alias for {@link Client.getChatMembers}.
808
- */
695
+ /** Context-aware alias for {@link Client.getChatMembers}. */
809
696
  async getChatMembers(params) {
810
697
  const chatId = this.#mustGetChatId();
811
698
  return await this.client.getChatMembers(chatId, params);
812
699
  }
813
- /**
814
- * Context-aware alias for {@link Client.getChatSettings}.
815
- */
700
+ /** Context-aware alias for {@link Client.getChatSettings}. */
816
701
  async getChatSettings() {
817
702
  const chatId = this.#mustGetChatId();
818
703
  return await this.client.getChatSettings(chatId);
819
704
  }
820
- /**
821
- * Context-aware alias for {@link Client.getClaimedGifts}.
822
- */
705
+ /** Context-aware alias for {@link Client.getClaimedGifts}. */
823
706
  async getClaimedGifts(params) {
824
707
  const chatId = this.#mustGetChatId();
825
708
  return await this.client.getClaimedGifts(chatId, params);
826
709
  }
827
- /**
828
- * Context-aware alias for {@link Client.getChatSettings}.
829
- */
710
+ /** Context-aware alias for {@link Client.getChatSettings}. */
830
711
  async getCommonChats() {
831
712
  const chatId = this.#mustGetChatId();
832
713
  return await this.client.getCommonChats(chatId);
833
714
  }
834
- /**
835
- * Context-aware alias for {@link Client.getCreatedInviteLinks}.
836
- */
715
+ /** Context-aware alias for {@link Client.getCreatedInviteLinks}. */
837
716
  async getCreatedInviteLinks(params) {
838
717
  const chatId = this.#mustGetChatId();
839
718
  return await this.client.getCreatedInviteLinks(chatId, params);
840
719
  }
841
- /**
842
- * Context-aware alias for {@link Client.getHistory}.
843
- */
720
+ /** Context-aware alias for {@link Client.getHistory}. */
844
721
  async getHistory(params) {
845
722
  const chatId = this.#mustGetChatId();
846
723
  return await this.client.getHistory(chatId, params);
847
724
  }
848
- /**
849
- * Context-aware alias for {@link Client.getJoinRequests}.
850
- */
725
+ /** Context-aware alias for {@link Client.getJoinRequests}. */
851
726
  async getJoinRequests(params) {
852
727
  const chatId = this.#mustGetChatId();
853
728
  return await this.client.getJoinRequests(chatId, params);
854
729
  }
855
- /**
856
- * Context-aware alias for {@link Client.getMessage}.
857
- */
730
+ /** Context-aware alias for {@link Client.getMessage}. */
858
731
  async getMessage(messageId) {
859
732
  const chatId = this.#mustGetChatId();
860
733
  return await this.client.getMessage(chatId, messageId);
861
734
  }
862
- /**
863
- * Context-aware alias for {@link Client.getMessageReactions}.
864
- */
735
+ /** Context-aware alias for {@link Client.getMessageReactions}. */
865
736
  async getMessageReactions(messageId) {
866
737
  const chatId = this.#mustGetChatId();
867
738
  return await this.client.getMessageReactions(chatId, messageId);
868
739
  }
869
- /**
870
- * Context-aware alias for {@link Client.getMessages}.
871
- */
740
+ /** Context-aware alias for {@link Client.getMessages}. */
872
741
  async getMessages(messageIds) {
873
742
  const chatId = this.#mustGetChatId();
874
743
  return await this.client.getMessages(chatId, messageIds);
875
744
  }
876
- /**
877
- * Context-aware alias for {@link Client.getSavedMessages}.
878
- */
745
+ /** Context-aware alias for {@link Client.getSavedMessages}. */
879
746
  async getSavedMessages(params) {
880
747
  const chatId = this.#mustGetChatId();
881
748
  return await this.client.getSavedMessages(chatId, params);
882
749
  }
883
- /**
884
- * Context-aware alias for {@link Client.getSimilarBots}.
885
- */
750
+ /** Context-aware alias for {@link Client.getSimilarBots}. */
886
751
  async getSimilarBots() {
887
752
  const chatId = this.#mustGetChatId();
888
753
  return await this.client.getSimilarBots(chatId);
889
754
  }
890
- /**
891
- * Context-aware alias for {@link Client.getSimilarChannels}.
892
- */
755
+ /** Context-aware alias for {@link Client.getSimilarChannels}. */
893
756
  async getSimilarChannels() {
894
757
  const chatId = this.#mustGetChatId();
895
758
  return await this.client.getSimilarChannels(chatId);
896
759
  }
897
- /**
898
- * Context-aware alias for {@link Client.getStories}.
899
- */
760
+ /** Context-aware alias for {@link Client.getStories}. */
900
761
  async getStories(storyIds) {
901
762
  const chatId = this.#mustGetChatId();
902
763
  return await this.client.getStories(chatId, storyIds);
903
764
  }
904
- /**
905
- * Context-aware alias for {@link Client.getStory}.
906
- */
765
+ /** Context-aware alias for {@link Client.getStory}. */
907
766
  async getStory(storyId) {
908
767
  const chatId = this.#mustGetChatId();
909
768
  return await this.client.getStory(chatId, storyId);
910
769
  }
911
- /**
912
- * Context-aware alias for {@link Client.sendGift}.
913
- */
770
+ /** Context-aware alias for {@link Client.sendGift}. */
914
771
  async gift(giftId, params) {
915
772
  const chatId = this.#mustGetChatId();
916
773
  return await this.client.sendGift(chatId, giftId, params);
917
774
  }
918
- /**
919
- * Context-aware alias for {@link Client.hideGeneralTopic}.
920
- */
775
+ /** Context-aware alias for {@link Client.hideGeneralTopic}. */
921
776
  async hideGeneralTopic() {
922
777
  const chatId = this.#mustGetChatId();
923
778
  return await this.client.hideGeneralTopic(chatId);
924
779
  }
925
- /**
926
- * Context-aware alias for {@link Client.hideMemberList}.
927
- */
780
+ /** Context-aware alias for {@link Client.hideMemberList}. */
928
781
  async hideMemberList() {
929
782
  const chatId = this.#mustGetChatId();
930
783
  return await this.client.hideMemberList(chatId);
931
784
  }
932
- /**
933
- * Context-aware alias for {@link Client.kickChatMember}.
934
- */
785
+ /** Context-aware alias for {@link Client.kickChatMember}. */
935
786
  async kickChatMember(memberId) {
936
787
  const chatId = this.#mustGetChatId();
937
788
  return await this.client.kickChatMember(chatId, memberId);
938
789
  }
939
- /**
940
- * Context-aware alias for {@link Client.kickChatMember}.
941
- */
790
+ /** Context-aware alias for {@link Client.kickChatMember}. */
942
791
  async kickSender() {
943
792
  const { chatId, senderId } = this.#mustGetMsg();
944
793
  if (!senderId) {
@@ -946,351 +795,257 @@ export class Context {
946
795
  }
947
796
  return await this.client.kickChatMember(chatId, senderId);
948
797
  }
949
- /**
950
- * Context-aware alias for {@link Client.leaveChat}.
951
- */
798
+ /** Context-aware alias for {@link Client.leaveChat}. */
952
799
  async leaveChat() {
953
800
  const chatId = this.#mustGetChatId();
954
801
  return await this.client.leaveChat(chatId);
955
802
  }
956
- /**
957
- * Context-aware alias for {@link Client.openChat}.
958
- */
803
+ /** Context-aware alias for {@link Client.openChat}. */
959
804
  async open() {
960
805
  const chatId = this.#mustGetChatId();
961
806
  return await this.client.openChat(chatId);
962
807
  }
963
- /**
964
- * Context-aware alias for {@link Client.pauseBusinessBotConnection}.
965
- */
808
+ /** Context-aware alias for {@link Client.pauseBusinessBotConnection}. */
966
809
  async pauseBusinessBotConnection() {
967
810
  const chatId = this.#mustGetChatId();
968
811
  return await this.client.pauseBusinessBotConnection(chatId);
969
812
  }
970
- /**
971
- * Context-aware alias for {@link Client.pinMessage}.
972
- */
813
+ /** Context-aware alias for {@link Client.pinMessage}. */
973
814
  async pin(params) {
974
815
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
975
816
  return await this.client.pinMessage(chatId, messageId, { ...params, businessConnectionId });
976
817
  }
977
- /**
978
- * Context-aware alias for {@link Client.pinMessage}.
979
- */
818
+ /** Context-aware alias for {@link Client.pinMessage}. */
980
819
  async pinMessage(messageId, params) {
981
820
  const chatId = this.#mustGetChatId();
982
821
  return await this.client.pinMessage(chatId, messageId, params);
983
822
  }
984
- /**
985
- * Context-aware alias for {@link Client.pinTopic}.
986
- */
823
+ /** Context-aware alias for {@link Client.pinTopic}. */
987
824
  async pinTopic(topicId) {
988
825
  const chatId = this.#mustGetChatId();
989
826
  return await this.client.pinTopic(chatId, topicId);
990
827
  }
991
- /**
992
- * Context-aware alias for {@link Client.promoteChatMember}.
993
- */
828
+ /** Context-aware alias for {@link Client.promoteChatMember}. */
994
829
  async promoteChatMember(userId, params) {
995
830
  const chatId = this.#mustGetChatId();
996
831
  return await this.client.promoteChatMember(chatId, userId, params);
997
832
  }
998
- /**
999
- * Context-aware alias for {@link Client.setReactions}.
1000
- */
833
+ /** Context-aware alias for {@link Client.setReactions}. */
1001
834
  async react(reactions, params) {
1002
835
  const { chatId, messageId } = this.#mustGetMsg();
1003
836
  return await this.client.setReactions(chatId, messageId, reactions, params);
1004
837
  }
1005
- /**
1006
- * Context-aware alias for {@link Client.readMessages}.
1007
- */
838
+ /** Context-aware alias for {@link Client.readMessages}. */
1008
839
  async read() {
1009
840
  const { chatId, messageId } = this.#mustGetMsg();
1010
841
  return await this.client.readMessages(chatId, messageId);
1011
842
  }
1012
- /**
1013
- * Context-aware alias for {@link Client.refundStarPayment}.
1014
- */
843
+ /** Context-aware alias for {@link Client.refundStarPayment}. */
1015
844
  async refundStarPayment(telegramPaymentChargeId) {
1016
845
  const chatId = this.#mustGetChatId();
1017
846
  return await this.client.refundStarPayment(chatId, telegramPaymentChargeId);
1018
847
  }
1019
- /**
1020
- * Context-aware alias for {@link Client.deleteContact}.
1021
- */
848
+ /** Context-aware alias for {@link Client.deleteContact}. */
1022
849
  async removeAsContact() {
1023
850
  const chatId = this.#mustGetChatId();
1024
851
  return await this.client.deleteContact(chatId);
1025
852
  }
1026
- /**
1027
- * Context-aware alias for {@link Client.removeReaction}.
1028
- */
853
+ /** Context-aware alias for {@link Client.removeReaction}. */
1029
854
  async removeReaction(messageId, reaction) {
1030
855
  const chatId = this.#mustGetChatId();
1031
856
  return await this.client.removeReaction(chatId, messageId, reaction);
1032
857
  }
1033
- /**
1034
- * Context-aware alias for {@link Client.removeStoriesFromHighlights}.
1035
- */
858
+ /** Context-aware alias for {@link Client.removeStoriesFromHighlights}. */
1036
859
  async removeStoriesFromHighlights(storyIds) {
1037
860
  const chatId = this.#mustGetChatId();
1038
861
  return await this.client.removeStoriesFromHighlights(chatId, storyIds);
1039
862
  }
1040
- /**
1041
- * Context-aware alias for {@link Client.removeStoryFromHighlights}.
1042
- */
863
+ /** Context-aware alias for {@link Client.removeStoryFromHighlights}. */
1043
864
  async removeStoryFromHighlights(storyId) {
1044
865
  const chatId = this.#mustGetChatId();
1045
866
  return await this.client.removeStoryFromHighlights(chatId, storyId);
1046
867
  }
1047
- /**
1048
- * Context-aware alias for {@link Client.reopenTopic}.
1049
- */
868
+ /** Context-aware alias for {@link Client.reopenTopic}. */
1050
869
  async reopenTopic(topicId) {
1051
870
  const chatId = this.#mustGetChatId();
1052
871
  return await this.client.reopenTopic(chatId, topicId);
1053
872
  }
1054
- /**
1055
- * Context-aware alias for {@link Client.sendMessage}.
1056
- */
873
+ /** Context-aware alias for {@link Client.sendMessage}. */
1057
874
  async reply(text, params) {
1058
875
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1059
876
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1060
877
  return await this.client.sendMessage(chatId, text, { ...params, ...replyTo, businessConnectionId });
1061
878
  }
1062
- /**
1063
- * Context-aware alias for {@link Client.sendAnimation}.
1064
- */
879
+ /** Context-aware alias for {@link Client.sendAnimation}. */
1065
880
  async replyAnimation(animation, params) {
1066
881
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1067
882
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1068
883
  return await this.client.sendAnimation(chatId, animation, { ...params, ...replyTo, businessConnectionId });
1069
884
  }
1070
- /**
1071
- * Context-aware alias for {@link Client.sendAudio}.
1072
- */
885
+ /** Context-aware alias for {@link Client.sendAudio}. */
1073
886
  async replyAudio(audio, params) {
1074
887
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1075
888
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1076
889
  return await this.client.sendAudio(chatId, audio, { ...params, ...replyTo, businessConnectionId });
1077
890
  }
1078
- /**
1079
- * Context-aware alias for {@link Client.sendChecklist}.
1080
- */
891
+ /** Context-aware alias for {@link Client.sendChecklist}. */
1081
892
  async replyChecklist(title, items, params) {
1082
893
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1083
894
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1084
895
  return await this.client.sendChecklist(chatId, title, items, { ...params, ...replyTo, businessConnectionId });
1085
896
  }
1086
- /**
1087
- * Context-aware alias for {@link Client.sendContact}.
1088
- */
897
+ /** Context-aware alias for {@link Client.sendContact}. */
1089
898
  async replyContact(firstName, number, params) {
1090
899
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1091
900
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1092
901
  return await this.client.sendContact(chatId, firstName, number, { ...params, ...replyTo, businessConnectionId });
1093
902
  }
1094
- /**
1095
- * Context-aware alias for {@link Client.sendDice}.
1096
- */
903
+ /** Context-aware alias for {@link Client.sendDice}. */
1097
904
  async replyDice(params) {
1098
905
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1099
906
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1100
907
  return await this.client.sendDice(chatId, { ...params, ...replyTo, businessConnectionId });
1101
908
  }
1102
- /**
1103
- * Context-aware alias for {@link Client.sendDocument}.
1104
- */
909
+ /** Context-aware alias for {@link Client.sendDocument}. */
1105
910
  async replyDocument(document, params) {
1106
911
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1107
912
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1108
913
  return await this.client.sendDocument(chatId, document, { ...params, ...replyTo, businessConnectionId });
1109
914
  }
1110
- /**
1111
- * Context-aware alias for {@link Client.sendMessageDraft}.
1112
- */
915
+ /** Context-aware alias for {@link Client.sendMessageDraft}. */
1113
916
  async replyDraft(draftId, text, params) {
1114
917
  const { chatId, messageId } = this.#mustGetMsg();
1115
918
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1116
919
  return await this.client.sendMessageDraft(chatId, draftId, text, { ...params, ...replyTo });
1117
920
  }
1118
- /**
1119
- * Context-aware alias for {@link Client.sendInvoice}.
1120
- */
921
+ /** Context-aware alias for {@link Client.sendInvoice}. */
1121
922
  async replyInvoice(title, description, payload, currency, prices, params) {
1122
923
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1123
924
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1124
925
  return await this.client.sendInvoice(chatId, title, description, payload, currency, prices, { ...params, ...replyTo, businessConnectionId });
1125
926
  }
1126
- /**
1127
- * Context-aware alias for {@link Client.sendLocation}.
1128
- */
927
+ /** Context-aware alias for {@link Client.sendLocation}. */
1129
928
  async replyLocation(latitude, longitude, params) {
1130
929
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1131
930
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1132
931
  return await this.client.sendLocation(chatId, latitude, longitude, { ...params, ...replyTo, businessConnectionId });
1133
932
  }
1134
- /**
1135
- * Context-aware alias for {@link Client.sendMediaGroup}.
1136
- */
933
+ /** Context-aware alias for {@link Client.sendMediaGroup}. */
1137
934
  async replyMediaGroup(media, params) {
1138
935
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1139
936
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1140
937
  return await this.client.sendMediaGroup(chatId, media, { ...params, ...replyTo, businessConnectionId });
1141
938
  }
1142
- /**
1143
- * Context-aware alias for {@link Client.sendPhoto}.
1144
- */
939
+ /** Context-aware alias for {@link Client.sendPhoto}. */
1145
940
  async replyPhoto(photo, params) {
1146
941
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1147
942
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1148
943
  return await this.client.sendPhoto(chatId, photo, { ...params, ...replyTo, businessConnectionId });
1149
944
  }
1150
- /**
1151
- * Context-aware alias for {@link Client.sendPoll}.
1152
- */
945
+ /** Context-aware alias for {@link Client.sendPoll}. */
1153
946
  async replyPoll(question, options, params) {
1154
947
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1155
948
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1156
949
  return await this.client.sendPoll(chatId, question, options, { ...params, ...replyTo, businessConnectionId });
1157
950
  }
1158
- /**
1159
- * Context-aware alias for {@link Client.sendSticker}.
1160
- */
951
+ /** Context-aware alias for {@link Client.sendSticker}. */
1161
952
  async replySticker(sticker, params) {
1162
953
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1163
954
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1164
955
  return await this.client.sendSticker(chatId, sticker, { ...params, ...replyTo, businessConnectionId });
1165
956
  }
1166
- /**
1167
- * Context-aware alias for {@link Client.sendVenue}.
1168
- */
957
+ /** Context-aware alias for {@link Client.sendVenue}. */
1169
958
  async replyVenue(latitude, longitude, title, address, params) {
1170
959
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1171
960
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1172
961
  return await this.client.sendVenue(chatId, latitude, longitude, title, address, { ...params, ...replyTo, businessConnectionId });
1173
962
  }
1174
- /**
1175
- * Context-aware alias for {@link Client.sendVideo}.
1176
- */
963
+ /** Context-aware alias for {@link Client.sendVideo}. */
1177
964
  async replyVideo(video, params) {
1178
965
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1179
966
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1180
967
  return await this.client.sendVideo(chatId, video, { ...params, ...replyTo, businessConnectionId });
1181
968
  }
1182
- /**
1183
- * Context-aware alias for {@link Client.sendVideoNote}.
1184
- */
969
+ /** Context-aware alias for {@link Client.sendVideoNote}. */
1185
970
  async replyVideoNote(videoNote, params) {
1186
971
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1187
972
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1188
973
  return await this.client.sendVideoNote(chatId, videoNote, { ...params, ...replyTo, businessConnectionId });
1189
974
  }
1190
- /**
1191
- * Context-aware alias for {@link Client.sendVoice}.
1192
- */
975
+ /** Context-aware alias for {@link Client.sendVoice}. */
1193
976
  async replyVoice(voice, params) {
1194
977
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1195
978
  const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
1196
979
  return await this.client.sendVoice(chatId, voice, { ...params, ...replyTo, businessConnectionId });
1197
980
  }
1198
- /**
1199
- * Context-aware alias for {@link Client.resumeBusinessBotConnection}.
1200
- */
981
+ /** Context-aware alias for {@link Client.resumeBusinessBotConnection}. */
1201
982
  async resumeBusinessBotConnection() {
1202
983
  const chatId = this.#mustGetChatId();
1203
984
  return await this.client.resumeBusinessBotConnection(chatId);
1204
985
  }
1205
- /**
1206
- * Context-aware alias for {@link Client.scheduleVideoChat}.
1207
- */
986
+ /** Context-aware alias for {@link Client.scheduleVideoChat}. */
1208
987
  async scheduleVideoChat(startAt, params) {
1209
988
  const chatId = this.#mustGetChatId();
1210
989
  return await this.client.scheduleVideoChat(chatId, startAt, params);
1211
990
  }
1212
- /**
1213
- * Context-aware alias for {@link Client.searchMessages}.
1214
- */
991
+ /** Context-aware alias for {@link Client.searchMessages}. */
1215
992
  async searchMessages(params) {
1216
993
  const chatId = this.#mustGetChatId();
1217
994
  params ??= {};
1218
995
  params.chatId = chatId;
1219
996
  return await this.client.searchMessages(params);
1220
997
  }
1221
- /**
1222
- * Context-aware alias for {@link Client.sendChatAction}.
1223
- */
998
+ /** Context-aware alias for {@link Client.sendChatAction}. */
1224
999
  async sendChatAction(action, params) {
1225
1000
  const chatId = this.#mustGetChatId();
1226
1001
  return await this.client.sendChatAction(chatId, action, params);
1227
1002
  }
1228
- /**
1229
- * Context-aware alias for {@link Client.sendScheduledMessage}.
1230
- */
1003
+ /** Context-aware alias for {@link Client.sendScheduledMessage}. */
1231
1004
  async sendScheduledMessage(messageId) {
1232
1005
  const chatId = this.#mustGetChatId();
1233
1006
  return await this.client.sendScheduledMessage(chatId, messageId);
1234
1007
  }
1235
- /**
1236
- * Context-aware alias for {@link Client.setAvailableReactions}.
1237
- */
1008
+ /** Context-aware alias for {@link Client.setAvailableReactions}. */
1238
1009
  async setAvailableReactions(availableReactions) {
1239
1010
  const chatId = this.#mustGetChatId();
1240
1011
  return await this.client.setAvailableReactions(chatId, availableReactions);
1241
1012
  }
1242
- /**
1243
- * Context-aware alias for {@link Client.setBoostsRequiredToCircumventRestrictions}.
1244
- */
1013
+ /** Context-aware alias for {@link Client.setBoostsRequiredToCircumventRestrictions}. */
1245
1014
  async setBoostsRequiredToCircumventRestrictions(boosts) {
1246
1015
  const chatId = this.#mustGetChatId();
1247
1016
  return await this.client.setBoostsRequiredToCircumventRestrictions(chatId, boosts);
1248
1017
  }
1249
- /**
1250
- * Context-aware alias for {@link Client.setChatDescription}.
1251
- */
1018
+ /** Context-aware alias for {@link Client.setChatDescription}. */
1252
1019
  async setChatDescription(description) {
1253
1020
  const chatId = this.#mustGetChatId();
1254
1021
  return await this.client.setChatDescription(chatId, description);
1255
1022
  }
1256
- /**
1257
- * Context-aware alias for {@link Client.setChatMemberRights}.
1258
- */
1023
+ /** Context-aware alias for {@link Client.setChatMemberRights}. */
1259
1024
  async setChatMemberRights(memberId, params) {
1260
1025
  const chatId = this.#mustGetChatId();
1261
1026
  return await this.client.setChatMemberRights(chatId, memberId, params);
1262
1027
  }
1263
- /**
1264
- * Context-aware alias for {@link Client.setChatPhoto}.
1265
- */
1028
+ /** Context-aware alias for {@link Client.setChatPhoto}. */
1266
1029
  async setChatPhoto(photo, params) {
1267
1030
  const chatId = this.#mustGetChatId();
1268
1031
  return await this.client.setChatPhoto(chatId, photo, params);
1269
1032
  }
1270
- /**
1271
- * Context-aware alias for {@link Client.setChatStickerSet}.
1272
- */
1033
+ /** Context-aware alias for {@link Client.setChatStickerSet}. */
1273
1034
  async setChatStickerSet(setName) {
1274
1035
  const chatId = this.#mustGetChatId();
1275
1036
  return await this.client.setChatStickerSet(chatId, setName);
1276
1037
  }
1277
- /**
1278
- * Context-aware alias for {@link Client.setChatTitle}.
1279
- */
1038
+ /** Context-aware alias for {@link Client.setChatTitle}. */
1280
1039
  async setChatTitle(title) {
1281
1040
  const chatId = this.#mustGetChatId();
1282
1041
  return await this.client.setChatTitle(chatId, title);
1283
1042
  }
1284
- /**
1285
- * Context-aware alias for {@link Client.setDiscussionChat}.
1286
- */
1043
+ /** Context-aware alias for {@link Client.setDiscussionChat}. */
1287
1044
  async setDiscussionChat(discussionChatId) {
1288
1045
  const chatId = this.#mustGetChatId();
1289
1046
  return await this.client.setDiscussionChat(chatId, discussionChatId);
1290
1047
  }
1291
- /**
1292
- * Context-aware alias for {@link Client.setChatMemberTag}.
1293
- */
1048
+ /** Context-aware alias for {@link Client.setChatMemberTag}. */
1294
1049
  async setMemberTag(params) {
1295
1050
  const { chatId, userId } = this.#mustGetMsg();
1296
1051
  if (!userId) {
@@ -1298,23 +1053,17 @@ export class Context {
1298
1053
  }
1299
1054
  return await this.client.setChatMemberTag(chatId, userId, params);
1300
1055
  }
1301
- /**
1302
- * Context-aware alias for {@link Client.setMessageTtl}.
1303
- */
1056
+ /** Context-aware alias for {@link Client.setMessageTtl}. */
1304
1057
  async setMessageTtl(messageTtl) {
1305
1058
  const chatId = this.#mustGetChatId();
1306
1059
  return await this.client.setMessageTtl(chatId, messageTtl);
1307
1060
  }
1308
- /**
1309
- * Context-aware alias for {@link Client.setReactions}.
1310
- */
1061
+ /** Context-aware alias for {@link Client.setReactions}. */
1311
1062
  async setReactions(messageId, reactions, params) {
1312
1063
  const chatId = this.#mustGetChatId();
1313
1064
  return await this.client.setReactions(chatId, messageId, reactions, params);
1314
1065
  }
1315
- /**
1316
- * Context-aware alias for {@link Client.setChatMemberRights}.
1317
- */
1066
+ /** Context-aware alias for {@link Client.setChatMemberRights}. */
1318
1067
  async setSenderRights(params) {
1319
1068
  const { chatId, senderId } = this.#mustGetMsg();
1320
1069
  if (!senderId) {
@@ -1322,120 +1071,86 @@ export class Context {
1322
1071
  }
1323
1072
  return await this.client.setChatMemberRights(chatId, senderId, params);
1324
1073
  }
1325
- /**
1326
- * Context-aware alias for {@link Client.setSlowMode}.
1327
- */
1074
+ /** Context-aware alias for {@link Client.setSlowMode}. */
1328
1075
  async setSlowMode(duration) {
1329
1076
  const chatId = this.#mustGetChatId();
1330
1077
  return await this.client.setSlowMode(chatId, duration);
1331
1078
  }
1332
- /**
1333
- * Context-aware alias for {@link Client.showGeneralTopic}.
1334
- */
1079
+ /** Context-aware alias for {@link Client.showGeneralTopic}. */
1335
1080
  async showGeneralTopic() {
1336
1081
  const chatId = this.#mustGetChatId();
1337
1082
  return await this.client.showGeneralTopic(chatId);
1338
1083
  }
1339
- /**
1340
- * Context-aware alias for {@link Client.showMemberList}.
1341
- */
1084
+ /** Context-aware alias for {@link Client.showMemberList}. */
1342
1085
  async showMemberList() {
1343
1086
  const chatId = this.#mustGetChatId();
1344
1087
  return await this.client.showMemberList(chatId);
1345
1088
  }
1346
- /**
1347
- * Context-aware alias for {@link Client.startVideoChat}.
1348
- */
1089
+ /** Context-aware alias for {@link Client.startVideoChat}. */
1349
1090
  async startVideoChat(params) {
1350
1091
  const chatId = this.#mustGetChatId();
1351
1092
  return await this.client.startVideoChat(chatId, params);
1352
1093
  }
1353
- /**
1354
- * Context-aware alias for {@link Client.stopPoll}.
1355
- */
1094
+ /** Context-aware alias for {@link Client.stopPoll}. */
1356
1095
  async stopPoll(messageId, params) {
1357
1096
  const chatId = this.#mustGetChatId();
1358
1097
  return await this.client.stopPoll(chatId, messageId, params);
1359
1098
  }
1360
- /**
1361
- * Context-aware alias for {@link Client.transcribeVoice}.
1362
- */
1099
+ /** Context-aware alias for {@link Client.transcribeVoice}. */
1363
1100
  async transcribeVoice(messageId) {
1364
1101
  const chatId = this.#mustGetChatId();
1365
1102
  return await this.client.transcribeVoice(chatId, messageId);
1366
1103
  }
1367
- /**
1368
- * Context-aware alias for {@link Client.transferChatOwnership}.
1369
- */
1104
+ /** Context-aware alias for {@link Client.transferChatOwnership}. */
1370
1105
  async transferOwnership(userId, password) {
1371
1106
  const chatId = this.#mustGetChatId();
1372
1107
  return await this.client.transferChatOwnership(chatId, userId, password);
1373
1108
  }
1374
- /**
1375
- * Context-aware alias for {@link Client.unarchiveChat}.
1376
- */
1109
+ /** Context-aware alias for {@link Client.unarchiveChat}. */
1377
1110
  async unarchive() {
1378
1111
  const chatId = this.#mustGetChatId();
1379
1112
  return await this.client.unarchiveChat(chatId);
1380
1113
  }
1381
- /**
1382
- * Context-aware alias for {@link Client.unbanChatMember}.
1383
- */
1114
+ /** Context-aware alias for {@link Client.unbanChatMember}. */
1384
1115
  async unbanChatMember(memberId) {
1385
1116
  const chatId = this.#mustGetChatId();
1386
1117
  return await this.client.unbanChatMember(chatId, memberId);
1387
1118
  }
1388
- /**
1389
- * Context-aware alias for {@link Client.unblockUser}.
1390
- */
1119
+ /** Context-aware alias for {@link Client.unblockUser}. */
1391
1120
  async unblockUser() {
1392
1121
  return await this.client.unblockUser(this.#mustGetUserId());
1393
1122
  }
1394
- /**
1395
- * Context-aware alias for {@link Client.uncheckChecklistItem}.
1396
- */
1123
+ /** Context-aware alias for {@link Client.uncheckChecklistItem}. */
1397
1124
  async uncheckChecklistItem(messageId, item) {
1398
1125
  const chatId = this.#mustGetChatId();
1399
1126
  return await this.client.uncheckChecklistItem(chatId, messageId, item);
1400
1127
  }
1401
- /**
1402
- * Context-aware alias for {@link Client.uncheckChecklistItems}.
1403
- */
1128
+ /** Context-aware alias for {@link Client.uncheckChecklistItems}. */
1404
1129
  async uncheckChecklistItems(messageId, items) {
1405
1130
  const chatId = this.#mustGetChatId();
1406
1131
  return await this.client.uncheckChecklistItems(chatId, messageId, items);
1407
1132
  }
1408
- /**
1409
- * Context-aware alias for {@link Client.unpinMessage}.
1410
- */
1133
+ /** Context-aware alias for {@link Client.unpinMessage}. */
1411
1134
  async unpin() {
1412
1135
  const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
1413
1136
  return await this.client.unpinMessage(chatId, messageId, { businessConnectionId });
1414
1137
  }
1415
- /**
1416
- * Context-aware alias for {@link Client.unpinMessage}.
1417
- */
1138
+ /** Context-aware alias for {@link Client.unpinMessage}. */
1418
1139
  async unpinMessage(messageId) {
1419
1140
  const chatId = this.#mustGetChatId();
1420
1141
  return await this.client.unpinMessage(chatId, messageId);
1421
1142
  }
1422
- /**
1423
- * Context-aware alias for {@link Client.unpinMessages}.
1424
- */
1143
+ /** Context-aware alias for {@link Client.unpinMessages}. */
1425
1144
  async unpinMessages() {
1426
1145
  const chatId = this.#mustGetChatId();
1427
1146
  return await this.client.unpinMessages(chatId);
1428
1147
  }
1429
- /**
1430
- * Context-aware alias for {@link Client.unpinTopic}.
1431
- */
1148
+ /** Context-aware alias for {@link Client.unpinTopic}. */
1432
1149
  async unpinTopic(topicId) {
1433
1150
  const chatId = this.#mustGetChatId();
1434
1151
  return await this.client.unpinTopic(chatId, topicId);
1435
1152
  }
1436
- /**
1437
- * Context-aware alias for {@link Client.updateChecklist}.
1438
- */
1153
+ /** Context-aware alias for {@link Client.updateChecklist}. */
1439
1154
  async updateChecklist(messageId, params) {
1440
1155
  const chatId = this.#mustGetChatId();
1441
1156
  return await this.client.updateChecklist(chatId, messageId, params);