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