@mtkruto/node 0.180.1 → 0.191.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.
- package/esm/3_types.d.ts +6 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +6 -0
- package/esm/client/0_params.d.ts +42 -30
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +1158 -1056
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.js +19 -12
- package/esm/client/2_file_manager.js +1 -1
- package/esm/client/3_account_manager.d.ts +6 -0
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +30 -1
- package/esm/client/3_message_manager.d.ts +3 -1
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +33 -19
- package/esm/client/3_secret_chat_manager.d.ts +3 -1
- package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
- package/esm/client/3_secret_chat_manager.js +77 -3
- package/esm/client/4_chat_manager.d.ts +2 -1
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +7 -1
- package/esm/client/4_context.d.ts +132 -48
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +336 -125
- package/esm/client/4_poll_manager.d.ts +3 -1
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +16 -5
- package/esm/client/6_client.d.ts +1158 -1056
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +1514 -1386
- package/esm/client/6_client_dispatcher.d.ts +1158 -1056
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +1478 -1356
- package/esm/types/0_checklist_changed.d.ts +1 -1
- package/esm/types/0_checklist_changed.d.ts.map +1 -1
- package/esm/types/0_location.d.ts +2 -2
- package/esm/types/0_location.d.ts.map +1 -1
- package/esm/types/0_message_viewer.d.ts +29 -0
- package/esm/types/0_message_viewer.d.ts.map +1 -0
- package/esm/types/0_message_viewer.js +25 -0
- package/esm/types/0_secret_chat_action_type.d.ts +69 -0
- package/esm/types/0_secret_chat_action_type.d.ts.map +1 -0
- package/esm/types/0_secret_chat_action_type.js +46 -0
- package/esm/types/1_chat_p.d.ts +1 -5
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_input_poll_media.d.ts +5 -5
- package/esm/types/1_input_poll_media.d.ts.map +1 -1
- package/esm/types/1_input_sticker.d.ts +1 -1
- package/esm/types/1_secret_chat_action.d.ts +30 -0
- package/esm/types/1_secret_chat_action.d.ts.map +1 -0
- package/esm/types/1_secret_chat_action.js +28 -0
- package/esm/types/1_sticker.d.ts +3 -3
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_video.d.ts +3 -3
- package/esm/types/1_video.d.ts.map +1 -1
- package/esm/types/1_video_note.d.ts +3 -3
- package/esm/types/1_video_note.d.ts.map +1 -1
- package/esm/types/2_poll_voter.d.ts +13 -0
- package/esm/types/2_poll_voter.d.ts.map +1 -0
- package/esm/types/2_poll_voter.js +18 -0
- package/esm/types/3_connected_website.d.ts +35 -0
- package/esm/types/3_connected_website.d.ts.map +1 -0
- package/esm/types/3_connected_website.js +39 -0
- package/esm/types/3_input_media.d.ts +5 -5
- package/esm/types/3_input_media.d.ts.map +1 -1
- package/esm/types/3_poll_voter_list.d.ts +31 -0
- package/esm/types/3_poll_voter_list.d.ts.map +1 -0
- package/esm/types/3_poll_voter_list.js +28 -0
- package/esm/types/4_reply_to.d.ts +2 -2
- package/esm/types/4_reply_to.d.ts.map +1 -1
- package/esm/types/6_message_content.d.ts +2 -2
- package/esm/types/6_message_content.d.ts.map +1 -1
- package/esm/types/9_message.d.ts +8 -1
- package/esm/types/9_message.d.ts.map +1 -1
- package/esm/types/9_message.js +3 -0
- package/esm/types/B_update.d.ts +25 -10
- package/esm/types/B_update.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +6 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +6 -0
- package/script/client/0_params.d.ts +42 -30
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +1158 -1056
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_client_encrypted.d.ts.map +1 -1
- package/script/client/2_client_encrypted.js +19 -12
- package/script/client/2_file_manager.js +1 -1
- package/script/client/3_account_manager.d.ts +6 -0
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +29 -0
- package/script/client/3_message_manager.d.ts +3 -1
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +32 -18
- package/script/client/3_secret_chat_manager.d.ts +3 -1
- package/script/client/3_secret_chat_manager.d.ts.map +1 -1
- package/script/client/3_secret_chat_manager.js +76 -2
- package/script/client/4_chat_manager.d.ts +2 -1
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +7 -1
- package/script/client/4_context.d.ts +132 -48
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +336 -125
- package/script/client/4_poll_manager.d.ts +3 -1
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +15 -4
- package/script/client/6_client.d.ts +1158 -1056
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +1514 -1386
- package/script/client/6_client_dispatcher.d.ts +1158 -1056
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +1478 -1356
- package/script/types/0_checklist_changed.d.ts +1 -1
- package/script/types/0_checklist_changed.d.ts.map +1 -1
- package/script/types/0_location.d.ts +2 -2
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_message_viewer.d.ts +29 -0
- package/script/types/0_message_viewer.d.ts.map +1 -0
- package/script/types/0_message_viewer.js +28 -0
- package/script/types/0_secret_chat_action_type.d.ts +69 -0
- package/script/types/0_secret_chat_action_type.d.ts.map +1 -0
- package/script/types/0_secret_chat_action_type.js +49 -0
- package/script/types/1_chat_p.d.ts +1 -5
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_input_poll_media.d.ts +5 -5
- package/script/types/1_input_poll_media.d.ts.map +1 -1
- package/script/types/1_input_sticker.d.ts +1 -1
- package/script/types/1_secret_chat_action.d.ts +30 -0
- package/script/types/1_secret_chat_action.d.ts.map +1 -0
- package/script/types/1_secret_chat_action.js +31 -0
- package/script/types/1_sticker.d.ts +3 -3
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_video.d.ts +3 -3
- package/script/types/1_video.d.ts.map +1 -1
- package/script/types/1_video_note.d.ts +3 -3
- package/script/types/1_video_note.d.ts.map +1 -1
- package/script/types/2_poll_voter.d.ts +13 -0
- package/script/types/2_poll_voter.d.ts.map +1 -0
- package/script/types/2_poll_voter.js +21 -0
- package/script/types/3_connected_website.d.ts +35 -0
- package/script/types/3_connected_website.d.ts.map +1 -0
- package/script/types/3_connected_website.js +42 -0
- package/script/types/3_input_media.d.ts +5 -5
- package/script/types/3_input_media.d.ts.map +1 -1
- package/script/types/3_poll_voter_list.d.ts +31 -0
- package/script/types/3_poll_voter_list.d.ts.map +1 -0
- package/script/types/3_poll_voter_list.js +31 -0
- package/script/types/4_reply_to.d.ts +2 -2
- package/script/types/4_reply_to.d.ts.map +1 -1
- package/script/types/6_message_content.d.ts +2 -2
- package/script/types/6_message_content.d.ts.map +1 -1
- package/script/types/9_message.d.ts +8 -1
- package/script/types/9_message.d.ts.map +1 -1
- package/script/types/9_message.js +3 -0
- package/script/types/B_update.d.ts +25 -10
- package/script/types/B_update.d.ts.map +1 -1
package/esm/client/4_context.js
CHANGED
|
@@ -368,6 +368,11 @@ export class Context {
|
|
|
368
368
|
return this.update;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
+
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
372
|
+
async acceptSecretChat() {
|
|
373
|
+
const id = this.#mustGetSecretChatId();
|
|
374
|
+
return await this.client.acceptSecretChat(id);
|
|
375
|
+
}
|
|
371
376
|
/** Context-aware alias for {@link Client.addContact}. */
|
|
372
377
|
async addAsContact(firstName, params) {
|
|
373
378
|
const chatId = this.#mustGetChatId();
|
|
@@ -383,16 +388,31 @@ export class Context {
|
|
|
383
388
|
const chatId = this.#mustGetChatId();
|
|
384
389
|
return await this.client.addChatMembers(chatId, userIds);
|
|
385
390
|
}
|
|
391
|
+
/** Context-aware alias for {@link Client.addPollOption}. */
|
|
392
|
+
async addPollOption(messageId, option) {
|
|
393
|
+
const chatId = this.#mustGetChatId();
|
|
394
|
+
return await this.client.addPollOption(chatId, messageId, option);
|
|
395
|
+
}
|
|
386
396
|
/** Context-aware alias for {@link Client.addReaction}. */
|
|
387
397
|
async addReaction(messageId, reaction, params) {
|
|
388
398
|
const chatId = this.#mustGetChatId();
|
|
389
399
|
return await this.client.addReaction(chatId, messageId, reaction, params);
|
|
390
400
|
}
|
|
401
|
+
/** Context-aware alias for {@link Client.addStoriesToAlbum}. */
|
|
402
|
+
async addStoriesToAlbum(albumId, storyIds) {
|
|
403
|
+
const chatId = this.#mustGetChatId();
|
|
404
|
+
return await this.client.addStoriesToAlbum(chatId, albumId, storyIds);
|
|
405
|
+
}
|
|
391
406
|
/** Context-aware alias for {@link Client.addStoriesToHighlights}. */
|
|
392
407
|
async addStoriesToHighlights(storyIds) {
|
|
393
408
|
const chatId = this.#mustGetChatId();
|
|
394
409
|
return await this.client.addStoriesToHighlights(chatId, storyIds);
|
|
395
410
|
}
|
|
411
|
+
/** Context-aware alias for {@link Client.addStoryToAlbum}. */
|
|
412
|
+
async addStoryToAlbum(albumId, storyId) {
|
|
413
|
+
const chatId = this.#mustGetChatId();
|
|
414
|
+
return await this.client.addStoryToAlbum(chatId, albumId, storyId);
|
|
415
|
+
}
|
|
396
416
|
/** Context-aware alias for {@link Client.addStoryToHighlights}. */
|
|
397
417
|
async addStoryToHighlights(storyId) {
|
|
398
418
|
const chatId = this.#mustGetChatId();
|
|
@@ -496,6 +516,11 @@ export class Context {
|
|
|
496
516
|
const chatId = this.#mustGetChatId();
|
|
497
517
|
return await this.client.createStory(chatId, content, params);
|
|
498
518
|
}
|
|
519
|
+
/** Context-aware alias for {@link Client.createStoryAlbum}. */
|
|
520
|
+
async createStoryAlbum(name, storyIds) {
|
|
521
|
+
const chatId = this.#mustGetChatId();
|
|
522
|
+
return await this.client.createStoryAlbum(chatId, name, storyIds);
|
|
523
|
+
}
|
|
499
524
|
/** Context-aware alias for {@link Client.createTopic}. */
|
|
500
525
|
async createTopic(title, params) {
|
|
501
526
|
const chatId = this.#mustGetChatId();
|
|
@@ -514,11 +539,6 @@ export class Context {
|
|
|
514
539
|
const chatId = this.#mustGetChatId();
|
|
515
540
|
return await this.client.declineJoinRequests(chatId, params);
|
|
516
541
|
}
|
|
517
|
-
/** Context-aware alias for {@link Client.deleteChatPhoto}. */
|
|
518
|
-
async deleteChatPhoto() {
|
|
519
|
-
const chatId = this.#mustGetChatId();
|
|
520
|
-
return await this.client.deleteChatPhoto(chatId);
|
|
521
|
-
}
|
|
522
542
|
/** Context-aware alias for {@link Client.deleteMessage}. */
|
|
523
543
|
async delete() {
|
|
524
544
|
const { chatId, messageId } = this.#mustGetMsg();
|
|
@@ -534,6 +554,11 @@ export class Context {
|
|
|
534
554
|
const chatId = this.#mustGetChatId();
|
|
535
555
|
return await this.client.deleteChatMemberMessages(chatId, userId);
|
|
536
556
|
}
|
|
557
|
+
/** Context-aware alias for {@link Client.deleteChatPhoto}. */
|
|
558
|
+
async deleteChatPhoto() {
|
|
559
|
+
const chatId = this.#mustGetChatId();
|
|
560
|
+
return await this.client.deleteChatPhoto(chatId);
|
|
561
|
+
}
|
|
537
562
|
/** Context-aware alias for {@link Client.deleteChatStickerSet}. */
|
|
538
563
|
async deleteChatStickerSet() {
|
|
539
564
|
const chatId = this.#mustGetChatId();
|
|
@@ -579,6 +604,11 @@ export class Context {
|
|
|
579
604
|
const chatId = this.#mustGetChatId();
|
|
580
605
|
return await this.client.disableBusinessBots(chatId);
|
|
581
606
|
}
|
|
607
|
+
/** Context-aware alias for {@link Client.disableChatHistoryForNewMembers}. */
|
|
608
|
+
async disableChatHistoryForNewMembers() {
|
|
609
|
+
const chatId = this.#mustGetChatId();
|
|
610
|
+
return await this.client.disableChatHistoryForNewMembers(chatId);
|
|
611
|
+
}
|
|
582
612
|
/** Context-aware alias for {@link Client.disableJoinRequests}. */
|
|
583
613
|
async disableJoinRequests() {
|
|
584
614
|
const chatId = this.#mustGetChatId();
|
|
@@ -624,16 +654,16 @@ export class Context {
|
|
|
624
654
|
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
625
655
|
return await this.client.editInlineMessageReplyMarkup(inlineMessageId, params);
|
|
626
656
|
}
|
|
627
|
-
/** Context-aware alias for {@link Client.editInlineMessageText}. */
|
|
628
|
-
async editInlineMessageText(text, params) {
|
|
629
|
-
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
630
|
-
return await this.client.editInlineMessageText(inlineMessageId, text, params);
|
|
631
|
-
}
|
|
632
657
|
/** Context-aware alias for {@link Client.editInlineMessageRichText}. */
|
|
633
658
|
async editInlineMessageRichText(richText, params) {
|
|
634
659
|
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
635
660
|
return await this.client.editInlineMessageRichText(inlineMessageId, richText, params);
|
|
636
661
|
}
|
|
662
|
+
/** Context-aware alias for {@link Client.editInlineMessageText}. */
|
|
663
|
+
async editInlineMessageText(text, params) {
|
|
664
|
+
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
665
|
+
return await this.client.editInlineMessageText(inlineMessageId, text, params);
|
|
666
|
+
}
|
|
637
667
|
/** Context-aware alias for {@link Client.editMessageCaption}. */
|
|
638
668
|
async editMessageCaption(messageId, params) {
|
|
639
669
|
const chatId = this.#mustGetChatId();
|
|
@@ -654,21 +684,16 @@ export class Context {
|
|
|
654
684
|
const chatId = this.#mustGetChatId();
|
|
655
685
|
return await this.client.editMessageReplyMarkup(chatId, messageId, params);
|
|
656
686
|
}
|
|
657
|
-
/** Context-aware alias for {@link Client.editMessageText}. */
|
|
658
|
-
async editMessageText(messageId, text, params) {
|
|
659
|
-
const chatId = this.#mustGetChatId();
|
|
660
|
-
return await this.client.editMessageText(chatId, messageId, text, params);
|
|
661
|
-
}
|
|
662
|
-
/** Context-aware alias for {@link Client.getRichText}. */
|
|
663
|
-
async getRichText(messageId) {
|
|
664
|
-
const chatId = this.#mustGetChatId();
|
|
665
|
-
return await this.client.getRichText(chatId, messageId);
|
|
666
|
-
}
|
|
667
687
|
/** Context-aware alias for {@link Client.editMessageRichText}. */
|
|
668
688
|
async editMessageRichText(messageId, richText, params) {
|
|
669
689
|
const chatId = this.#mustGetChatId();
|
|
670
690
|
return await this.client.editMessageRichText(chatId, messageId, richText, params);
|
|
671
691
|
}
|
|
692
|
+
/** Context-aware alias for {@link Client.editMessageText}. */
|
|
693
|
+
async editMessageText(messageId, text, params) {
|
|
694
|
+
const chatId = this.#mustGetChatId();
|
|
695
|
+
return await this.client.editMessageText(chatId, messageId, text, params);
|
|
696
|
+
}
|
|
672
697
|
/** Context-aware alias for {@link Client.editTopic}. */
|
|
673
698
|
async editTopic(topicId, title, params) {
|
|
674
699
|
const chatId = this.#mustGetChatId();
|
|
@@ -684,6 +709,11 @@ export class Context {
|
|
|
684
709
|
const chatId = this.#mustGetChatId();
|
|
685
710
|
return await this.client.enableBusinessBots(chatId);
|
|
686
711
|
}
|
|
712
|
+
/** Context-aware alias for {@link Client.enableChatHistoryForNewMembers}. */
|
|
713
|
+
async enableChatHistoryForNewMembers() {
|
|
714
|
+
const chatId = this.#mustGetChatId();
|
|
715
|
+
return await this.client.enableChatHistoryForNewMembers(chatId);
|
|
716
|
+
}
|
|
687
717
|
/** Context-aware alias for {@link Client.enableJoinRequests}. */
|
|
688
718
|
async enableJoinRequests() {
|
|
689
719
|
const chatId = this.#mustGetChatId();
|
|
@@ -704,6 +734,11 @@ export class Context {
|
|
|
704
734
|
const chatId = this.#mustGetChatId();
|
|
705
735
|
return await this.client.enableTopics(chatId, isShownAsTabs);
|
|
706
736
|
}
|
|
737
|
+
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
738
|
+
async endSecretChat(params) {
|
|
739
|
+
const id = this.#mustGetSecretChatId();
|
|
740
|
+
return await this.client.endSecretChat(id, params);
|
|
741
|
+
}
|
|
707
742
|
/** Context-aware alias for {@link Client.forwardMessage}. */
|
|
708
743
|
async forward(to, params) {
|
|
709
744
|
const { chatId, messageId } = this.#mustGetMsg();
|
|
@@ -782,21 +817,56 @@ export class Context {
|
|
|
782
817
|
const chatId = this.#mustGetChatId();
|
|
783
818
|
return await this.client.getMessage(chatId, messageId);
|
|
784
819
|
}
|
|
820
|
+
/** Context-aware alias for {@link Client.getMessageCounters}. */
|
|
821
|
+
async getMessageCounters(messageId) {
|
|
822
|
+
const chatId = this.#mustGetChatId();
|
|
823
|
+
return await this.client.getMessageCounters(chatId, messageId);
|
|
824
|
+
}
|
|
785
825
|
/** Context-aware alias for {@link Client.getMessageReactions}. */
|
|
786
826
|
async getMessageReactions(messageId) {
|
|
787
827
|
const chatId = this.#mustGetChatId();
|
|
788
828
|
return await this.client.getMessageReactions(chatId, messageId);
|
|
789
829
|
}
|
|
830
|
+
/** Context-aware alias for {@link Client.getMessageReadDate}. */
|
|
831
|
+
async getMessageReadDate(messageId) {
|
|
832
|
+
const chatId = this.#mustGetChatId();
|
|
833
|
+
return await this.client.getMessageReadDate(chatId, messageId);
|
|
834
|
+
}
|
|
790
835
|
/** Context-aware alias for {@link Client.getMessages}. */
|
|
791
836
|
async getMessages(messageIds) {
|
|
792
837
|
const chatId = this.#mustGetChatId();
|
|
793
838
|
return await this.client.getMessages(chatId, messageIds);
|
|
794
839
|
}
|
|
840
|
+
/** Context-aware alias for {@link Client.getMessagesCounters}. */
|
|
841
|
+
async getMessagesCounters(messageIds) {
|
|
842
|
+
const chatId = this.#mustGetChatId();
|
|
843
|
+
return await this.client.getMessagesCounters(chatId, messageIds);
|
|
844
|
+
}
|
|
845
|
+
/** Context-aware alias for {@link Client.getOnlineCount}. */
|
|
846
|
+
async getOnlineCount() {
|
|
847
|
+
const chatId = this.#mustGetChatId();
|
|
848
|
+
return await this.client.getOnlineCount(chatId);
|
|
849
|
+
}
|
|
850
|
+
/** Context-aware alias for {@link Client.getPollVoters}. */
|
|
851
|
+
async getPollVoters(messageId, params) {
|
|
852
|
+
const chatId = this.#mustGetChatId();
|
|
853
|
+
return await this.client.getPollVoters(chatId, messageId, params);
|
|
854
|
+
}
|
|
855
|
+
/** Context-aware alias for {@link Client.getRichText}. */
|
|
856
|
+
async getRichText(messageId) {
|
|
857
|
+
const chatId = this.#mustGetChatId();
|
|
858
|
+
return await this.client.getRichText(chatId, messageId);
|
|
859
|
+
}
|
|
795
860
|
/** Context-aware alias for {@link Client.getSavedMessages}. */
|
|
796
861
|
async getSavedMessages(params) {
|
|
797
862
|
const chatId = this.#mustGetChatId();
|
|
798
863
|
return await this.client.getSavedMessages(chatId, params);
|
|
799
864
|
}
|
|
865
|
+
/** Context-aware alias for {@link Client.getScheduledMessages}. */
|
|
866
|
+
async getScheduledMessages() {
|
|
867
|
+
const chatId = this.#mustGetChatId();
|
|
868
|
+
return await this.client.getScheduledMessages(chatId);
|
|
869
|
+
}
|
|
800
870
|
/** Context-aware alias for {@link Client.getSimilarBots}. */
|
|
801
871
|
async getSimilarBots() {
|
|
802
872
|
const chatId = this.#mustGetChatId();
|
|
@@ -807,16 +877,41 @@ export class Context {
|
|
|
807
877
|
const chatId = this.#mustGetChatId();
|
|
808
878
|
return await this.client.getSimilarChannels(chatId);
|
|
809
879
|
}
|
|
880
|
+
/** Context-aware alias for {@link Client.getStarBalance}. */
|
|
881
|
+
async getStarBalance() {
|
|
882
|
+
const chatId = this.#mustGetChatId();
|
|
883
|
+
return await this.client.getStarBalance(chatId);
|
|
884
|
+
}
|
|
885
|
+
/** Context-aware alias for {@link Client.getStarTransactions}. */
|
|
886
|
+
async getStarTransactions(params) {
|
|
887
|
+
const chatId = this.#mustGetChatId();
|
|
888
|
+
return await this.client.getStarTransactions(chatId, params);
|
|
889
|
+
}
|
|
810
890
|
/** Context-aware alias for {@link Client.getStories}. */
|
|
811
891
|
async getStories(storyIds) {
|
|
812
892
|
const chatId = this.#mustGetChatId();
|
|
813
893
|
return await this.client.getStories(chatId, storyIds);
|
|
814
894
|
}
|
|
895
|
+
/** Context-aware alias for {@link Client.getStoriesInAlbum}. */
|
|
896
|
+
async getStoriesInAlbum(albumId) {
|
|
897
|
+
const chatId = this.#mustGetChatId();
|
|
898
|
+
return await this.client.getStoriesInAlbum(chatId, albumId);
|
|
899
|
+
}
|
|
815
900
|
/** Context-aware alias for {@link Client.getStory}. */
|
|
816
901
|
async getStory(storyId) {
|
|
817
902
|
const chatId = this.#mustGetChatId();
|
|
818
903
|
return await this.client.getStory(chatId, storyId);
|
|
819
904
|
}
|
|
905
|
+
/** Context-aware alias for {@link Client.getStoryAlbums}. */
|
|
906
|
+
async getStoryAlbums() {
|
|
907
|
+
const chatId = this.#mustGetChatId();
|
|
908
|
+
return await this.client.getStoryAlbums(chatId);
|
|
909
|
+
}
|
|
910
|
+
/** Context-aware alias for {@link Client.getTonBalance}. */
|
|
911
|
+
async getTonBalance() {
|
|
912
|
+
const chatId = this.#mustGetChatId();
|
|
913
|
+
return await this.client.getTonBalance(chatId);
|
|
914
|
+
}
|
|
820
915
|
/** Context-aware alias for {@link Client.sendGift}. */
|
|
821
916
|
async gift(giftId, params) {
|
|
822
917
|
const chatId = this.#mustGetChatId();
|
|
@@ -832,6 +927,11 @@ export class Context {
|
|
|
832
927
|
const chatId = this.#mustGetChatId();
|
|
833
928
|
return await this.client.hideMemberList(chatId);
|
|
834
929
|
}
|
|
930
|
+
/** Context-aware alias for {@link Client.joinChat}. */
|
|
931
|
+
async joinChat() {
|
|
932
|
+
const chatId = this.#mustGetChatId();
|
|
933
|
+
return await this.client.joinChat(chatId);
|
|
934
|
+
}
|
|
835
935
|
/** Context-aware alias for {@link Client.kickChatMember}. */
|
|
836
936
|
async kickChatMember(memberId) {
|
|
837
937
|
const chatId = this.#mustGetChatId();
|
|
@@ -850,6 +950,16 @@ export class Context {
|
|
|
850
950
|
const chatId = this.#mustGetChatId();
|
|
851
951
|
return await this.client.leaveChat(chatId);
|
|
852
952
|
}
|
|
953
|
+
/** Context-aware alias for {@link Client.markChatAsRead}. */
|
|
954
|
+
async markChatAsRead() {
|
|
955
|
+
const chatId = this.#mustGetChatId();
|
|
956
|
+
return await this.client.markChatAsRead(chatId);
|
|
957
|
+
}
|
|
958
|
+
/** Context-aware alias for {@link Client.markChatAsUnread}. */
|
|
959
|
+
async markChatAsUnread() {
|
|
960
|
+
const chatId = this.#mustGetChatId();
|
|
961
|
+
return await this.client.markChatAsUnread(chatId);
|
|
962
|
+
}
|
|
853
963
|
/** Context-aware alias for {@link Client.openChat}. */
|
|
854
964
|
async open() {
|
|
855
965
|
const chatId = this.#mustGetChatId();
|
|
@@ -900,122 +1010,55 @@ export class Context {
|
|
|
900
1010
|
const chatId = this.#mustGetChatId();
|
|
901
1011
|
return await this.client.deleteContact(chatId);
|
|
902
1012
|
}
|
|
1013
|
+
/** Context-aware alias for {@link Client.removePollOption}. */
|
|
1014
|
+
async removePollOption(messageId, optionIndex) {
|
|
1015
|
+
const chatId = this.#mustGetChatId();
|
|
1016
|
+
return await this.client.removePollOption(chatId, messageId, optionIndex);
|
|
1017
|
+
}
|
|
903
1018
|
/** Context-aware alias for {@link Client.removeReaction}. */
|
|
904
1019
|
async removeReaction(messageId, reaction) {
|
|
905
1020
|
const chatId = this.#mustGetChatId();
|
|
906
1021
|
return await this.client.removeReaction(chatId, messageId, reaction);
|
|
907
1022
|
}
|
|
908
|
-
/** Context-aware alias for {@link Client.
|
|
909
|
-
async
|
|
1023
|
+
/** Context-aware alias for {@link Client.removeStoriesFromAlbum}. */
|
|
1024
|
+
async removeStoriesFromAlbum(albumId, storyIds) {
|
|
910
1025
|
const chatId = this.#mustGetChatId();
|
|
911
|
-
return await this.client.
|
|
912
|
-
}
|
|
913
|
-
/** Context-aware alias for {@link Client.removeUserReactions}. */
|
|
914
|
-
async removeUserReactions(userId) {
|
|
915
|
-
const chatId = this.#mustGetChatId();
|
|
916
|
-
return await this.client.removeUserReactions(chatId, userId);
|
|
1026
|
+
return await this.client.removeStoriesFromAlbum(chatId, albumId, storyIds);
|
|
917
1027
|
}
|
|
918
1028
|
/** Context-aware alias for {@link Client.removeStoriesFromHighlights}. */
|
|
919
1029
|
async removeStoriesFromHighlights(storyIds) {
|
|
920
1030
|
const chatId = this.#mustGetChatId();
|
|
921
1031
|
return await this.client.removeStoriesFromHighlights(chatId, storyIds);
|
|
922
1032
|
}
|
|
1033
|
+
/** Context-aware alias for {@link Client.removeStoryFromAlbum}. */
|
|
1034
|
+
async removeStoryFromAlbum(albumId, storyId) {
|
|
1035
|
+
const chatId = this.#mustGetChatId();
|
|
1036
|
+
return await this.client.removeStoryFromAlbum(chatId, albumId, storyId);
|
|
1037
|
+
}
|
|
923
1038
|
/** Context-aware alias for {@link Client.removeStoryFromHighlights}. */
|
|
924
1039
|
async removeStoryFromHighlights(storyId) {
|
|
925
1040
|
const chatId = this.#mustGetChatId();
|
|
926
1041
|
return await this.client.removeStoryFromHighlights(chatId, storyId);
|
|
927
1042
|
}
|
|
1043
|
+
/** Context-aware alias for {@link Client.removeUserReaction}. */
|
|
1044
|
+
async removeUserReaction(messageId, userId) {
|
|
1045
|
+
const chatId = this.#mustGetChatId();
|
|
1046
|
+
return await this.client.removeUserReaction(chatId, messageId, userId);
|
|
1047
|
+
}
|
|
1048
|
+
/** Context-aware alias for {@link Client.removeUserReactions}. */
|
|
1049
|
+
async removeUserReactions(userId) {
|
|
1050
|
+
const chatId = this.#mustGetChatId();
|
|
1051
|
+
return await this.client.removeUserReactions(chatId, userId);
|
|
1052
|
+
}
|
|
928
1053
|
/** Context-aware alias for {@link Client.reopenTopic}. */
|
|
929
1054
|
async reopenTopic(topicId) {
|
|
930
1055
|
const chatId = this.#mustGetChatId();
|
|
931
1056
|
return await this.client.reopenTopic(chatId, topicId);
|
|
932
1057
|
}
|
|
933
|
-
/** Context-aware alias for {@link Client.
|
|
934
|
-
async
|
|
935
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
936
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
937
|
-
return await this.client.sendSecretMessage(chatId, text, { ...params, replyToMessageId });
|
|
938
|
-
}
|
|
939
|
-
/** Context-aware alias for {@link Client.sendSecretLocation}. */
|
|
940
|
-
async replySecretLocation(latitude, longitude, params) {
|
|
941
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
942
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
943
|
-
return await this.client.sendSecretLocation(chatId, latitude, longitude, { ...params, replyToMessageId });
|
|
944
|
-
}
|
|
945
|
-
/** Context-aware alias for {@link Client.sendSecretVenue}. */
|
|
946
|
-
async replySecretVenue(latitude, longitude, title, address, params) {
|
|
947
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
948
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
949
|
-
return await this.client.sendSecretVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId });
|
|
950
|
-
}
|
|
951
|
-
/** Context-aware alias for {@link Client.sendSecretContact}. */
|
|
952
|
-
async replySecretContact(firstName, phoneNumber, params) {
|
|
953
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
954
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
955
|
-
return await this.client.sendSecretContact(chatId, firstName, phoneNumber, { ...params, replyToMessageId });
|
|
956
|
-
}
|
|
957
|
-
/** Context-aware alias for {@link Client.sendSecretDocument}. */
|
|
958
|
-
async replySecretDocument(document, params) {
|
|
959
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
960
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
961
|
-
return await this.client.sendSecretDocument(chatId, document, { ...params, replyToMessageId });
|
|
962
|
-
}
|
|
963
|
-
/** Context-aware alias for {@link Client.sendSecretPhoto}. */
|
|
964
|
-
async replySecretPhoto(photo, params) {
|
|
965
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
966
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
967
|
-
return await this.client.sendSecretPhoto(chatId, photo, { ...params, replyToMessageId });
|
|
968
|
-
}
|
|
969
|
-
/** Context-aware alias for {@link Client.sendSecretVideo}. */
|
|
970
|
-
async replySecretVideo(video, params) {
|
|
971
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
972
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
973
|
-
return await this.client.sendSecretVideo(chatId, video, { ...params, replyToMessageId });
|
|
974
|
-
}
|
|
975
|
-
/** Context-aware alias for {@link Client.sendSecretVideoNote}. */
|
|
976
|
-
async replySecretVideoNote(videoNote, params) {
|
|
977
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
978
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
979
|
-
return await this.client.sendSecretVideoNote(chatId, videoNote, { ...params, replyToMessageId });
|
|
980
|
-
}
|
|
981
|
-
/** Context-aware alias for {@link Client.sendSecretAnimation}. */
|
|
982
|
-
async replySecretAnimation(animation, params) {
|
|
983
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
984
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
985
|
-
return await this.client.sendSecretVideoNote(chatId, animation, { ...params, replyToMessageId });
|
|
986
|
-
}
|
|
987
|
-
/** Context-aware alias for {@link Client.sendSecretAudio}. */
|
|
988
|
-
async replySecretAudio(audio, params) {
|
|
989
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
990
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
991
|
-
return await this.client.sendSecretAudio(chatId, audio, { ...params, replyToMessageId });
|
|
992
|
-
}
|
|
993
|
-
/** Context-aware alias for {@link Client.sendSecretVoice}. */
|
|
994
|
-
async replySecretVoice(voice, params) {
|
|
995
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
996
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
997
|
-
return await this.client.sendSecretVoice(chatId, voice, { ...params, replyToMessageId });
|
|
998
|
-
}
|
|
999
|
-
/** Context-aware alias for {@link Client.sendSecretSticker}. */
|
|
1000
|
-
async replySecretSticker(sticker, params) {
|
|
1001
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1002
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1003
|
-
return await this.client.sendSecretSticker(chatId, sticker, { ...params, replyToMessageId });
|
|
1004
|
-
}
|
|
1005
|
-
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
1006
|
-
async acceptSecretChat() {
|
|
1007
|
-
const id = this.#mustGetSecretChatId();
|
|
1008
|
-
return await this.client.acceptSecretChat(id);
|
|
1009
|
-
}
|
|
1010
|
-
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
1011
|
-
async endSecretChat(params) {
|
|
1012
|
-
const id = this.#mustGetSecretChatId();
|
|
1013
|
-
return await this.client.endSecretChat(id, params);
|
|
1014
|
-
}
|
|
1015
|
-
/** Context-aware alias for {@link Client.requestSecretChat}. */
|
|
1016
|
-
async requestSecretChat() {
|
|
1058
|
+
/** Context-aware alias for {@link Client.reorderStoriesInAlbum}. */
|
|
1059
|
+
async reorderStoriesInAlbum(albumId, storyIds) {
|
|
1017
1060
|
const chatId = this.#mustGetChatId();
|
|
1018
|
-
return await this.client.
|
|
1061
|
+
return await this.client.reorderStoriesInAlbum(chatId, albumId, storyIds);
|
|
1019
1062
|
}
|
|
1020
1063
|
/** Context-aware alias for {@link Client.sendMessage}. */
|
|
1021
1064
|
async reply(text, params) {
|
|
@@ -1023,12 +1066,6 @@ export class Context {
|
|
|
1023
1066
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1024
1067
|
return await this.client.sendMessage(chatId, text, { ...params, ...replyTo, businessConnectionId });
|
|
1025
1068
|
}
|
|
1026
|
-
/** Context-aware alias for {@link Client.sendRichText}. */
|
|
1027
|
-
async replyRichText(richText, params) {
|
|
1028
|
-
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1029
|
-
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1030
|
-
return await this.client.sendRichText(chatId, richText, { ...params, ...replyTo, businessConnectionId });
|
|
1031
|
-
}
|
|
1032
1069
|
/** Context-aware alias for {@link Client.sendAnimation}. */
|
|
1033
1070
|
async replyAnimation(animation, params) {
|
|
1034
1071
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1071,18 +1108,18 @@ export class Context {
|
|
|
1071
1108
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1072
1109
|
return await this.client.sendMessageDraft(chatId, draftId, text, { ...params, ...replyTo });
|
|
1073
1110
|
}
|
|
1074
|
-
/** Context-aware alias for {@link Client.sendRichTextDraft}. */
|
|
1075
|
-
async replyRichTextDraft(draftId, richText, params) {
|
|
1076
|
-
const { chatId, messageId } = this.#mustGetMsg();
|
|
1077
|
-
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1078
|
-
return await this.client.sendRichTextDraft(chatId, draftId, richText, { ...params, ...replyTo });
|
|
1079
|
-
}
|
|
1080
1111
|
/** Context-aware alias for {@link Client.sendInvoice}. */
|
|
1081
1112
|
async replyInvoice(title, description, payload, currency, prices, params) {
|
|
1082
1113
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1083
1114
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1084
1115
|
return await this.client.sendInvoice(chatId, title, description, payload, currency, prices, { ...params, ...replyTo, businessConnectionId });
|
|
1085
1116
|
}
|
|
1117
|
+
/** Context-aware alias for {@link Client.sendLivePhoto}. */
|
|
1118
|
+
async replyLivePhoto(photo, video, params) {
|
|
1119
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1120
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1121
|
+
return await this.client.sendLivePhoto(chatId, photo, video, { ...params, ...replyTo, businessConnectionId });
|
|
1122
|
+
}
|
|
1086
1123
|
/** Context-aware alias for {@link Client.sendLocation}. */
|
|
1087
1124
|
async replyLocation(latitude, longitude, params) {
|
|
1088
1125
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1107,6 +1144,90 @@ export class Context {
|
|
|
1107
1144
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1108
1145
|
return await this.client.sendPoll(chatId, question, options, { ...params, ...replyTo, businessConnectionId });
|
|
1109
1146
|
}
|
|
1147
|
+
/** Context-aware alias for {@link Client.sendRichText}. */
|
|
1148
|
+
async replyRichText(richText, params) {
|
|
1149
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1150
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1151
|
+
return await this.client.sendRichText(chatId, richText, { ...params, ...replyTo, businessConnectionId });
|
|
1152
|
+
}
|
|
1153
|
+
/** Context-aware alias for {@link Client.sendRichTextDraft}. */
|
|
1154
|
+
async replyRichTextDraft(draftId, richText, params) {
|
|
1155
|
+
const { chatId, messageId } = this.#mustGetMsg();
|
|
1156
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1157
|
+
return await this.client.sendRichTextDraft(chatId, draftId, richText, { ...params, ...replyTo });
|
|
1158
|
+
}
|
|
1159
|
+
/** Context-aware alias for {@link Client.sendSecretMessage}. */
|
|
1160
|
+
async replySecret(text, params) {
|
|
1161
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1162
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1163
|
+
return await this.client.sendSecretMessage(chatId, text, { ...params, replyToMessageId });
|
|
1164
|
+
}
|
|
1165
|
+
/** Context-aware alias for {@link Client.sendSecretAnimation}. */
|
|
1166
|
+
async replySecretAnimation(animation, params) {
|
|
1167
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1168
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1169
|
+
return await this.client.sendSecretVideoNote(chatId, animation, { ...params, replyToMessageId });
|
|
1170
|
+
}
|
|
1171
|
+
/** Context-aware alias for {@link Client.sendSecretAudio}. */
|
|
1172
|
+
async replySecretAudio(audio, params) {
|
|
1173
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1174
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1175
|
+
return await this.client.sendSecretAudio(chatId, audio, { ...params, replyToMessageId });
|
|
1176
|
+
}
|
|
1177
|
+
/** Context-aware alias for {@link Client.sendSecretContact}. */
|
|
1178
|
+
async replySecretContact(firstName, phoneNumber, params) {
|
|
1179
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1180
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1181
|
+
return await this.client.sendSecretContact(chatId, firstName, phoneNumber, { ...params, replyToMessageId });
|
|
1182
|
+
}
|
|
1183
|
+
/** Context-aware alias for {@link Client.sendSecretDocument}. */
|
|
1184
|
+
async replySecretDocument(document, params) {
|
|
1185
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1186
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1187
|
+
return await this.client.sendSecretDocument(chatId, document, { ...params, replyToMessageId });
|
|
1188
|
+
}
|
|
1189
|
+
/** Context-aware alias for {@link Client.sendSecretLocation}. */
|
|
1190
|
+
async replySecretLocation(latitude, longitude, params) {
|
|
1191
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1192
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1193
|
+
return await this.client.sendSecretLocation(chatId, latitude, longitude, { ...params, replyToMessageId });
|
|
1194
|
+
}
|
|
1195
|
+
/** Context-aware alias for {@link Client.sendSecretPhoto}. */
|
|
1196
|
+
async replySecretPhoto(photo, params) {
|
|
1197
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1198
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1199
|
+
return await this.client.sendSecretPhoto(chatId, photo, { ...params, replyToMessageId });
|
|
1200
|
+
}
|
|
1201
|
+
/** Context-aware alias for {@link Client.sendSecretSticker}. */
|
|
1202
|
+
async replySecretSticker(sticker, params) {
|
|
1203
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1204
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1205
|
+
return await this.client.sendSecretSticker(chatId, sticker, { ...params, replyToMessageId });
|
|
1206
|
+
}
|
|
1207
|
+
/** Context-aware alias for {@link Client.sendSecretVenue}. */
|
|
1208
|
+
async replySecretVenue(latitude, longitude, title, address, params) {
|
|
1209
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1210
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1211
|
+
return await this.client.sendSecretVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId });
|
|
1212
|
+
}
|
|
1213
|
+
/** Context-aware alias for {@link Client.sendSecretVideo}. */
|
|
1214
|
+
async replySecretVideo(video, params) {
|
|
1215
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1216
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1217
|
+
return await this.client.sendSecretVideo(chatId, video, { ...params, replyToMessageId });
|
|
1218
|
+
}
|
|
1219
|
+
/** Context-aware alias for {@link Client.sendSecretVideoNote}. */
|
|
1220
|
+
async replySecretVideoNote(videoNote, params) {
|
|
1221
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1222
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1223
|
+
return await this.client.sendSecretVideoNote(chatId, videoNote, { ...params, replyToMessageId });
|
|
1224
|
+
}
|
|
1225
|
+
/** Context-aware alias for {@link Client.sendSecretVoice}. */
|
|
1226
|
+
async replySecretVoice(voice, params) {
|
|
1227
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1228
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1229
|
+
return await this.client.sendSecretVoice(chatId, voice, { ...params, replyToMessageId });
|
|
1230
|
+
}
|
|
1110
1231
|
/** Context-aware alias for {@link Client.sendSticker}. */
|
|
1111
1232
|
async replySticker(sticker, params) {
|
|
1112
1233
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1137,11 +1258,36 @@ export class Context {
|
|
|
1137
1258
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1138
1259
|
return await this.client.sendVoice(chatId, voice, { ...params, ...replyTo, businessConnectionId });
|
|
1139
1260
|
}
|
|
1261
|
+
/** Context-aware alias for {@link Client.reportChat}. */
|
|
1262
|
+
async reportChat(reason, params) {
|
|
1263
|
+
const chatId = this.#mustGetChatId();
|
|
1264
|
+
return await this.client.reportChat(chatId, reason, params);
|
|
1265
|
+
}
|
|
1266
|
+
/** Context-aware alias for {@link Client.reportStories}. */
|
|
1267
|
+
async reportStories(storyIds, params) {
|
|
1268
|
+
const chatId = this.#mustGetChatId();
|
|
1269
|
+
return await this.client.reportStories(chatId, storyIds, params);
|
|
1270
|
+
}
|
|
1271
|
+
/** Context-aware alias for {@link Client.reportStory}. */
|
|
1272
|
+
async reportStory(storyId, params) {
|
|
1273
|
+
const chatId = this.#mustGetChatId();
|
|
1274
|
+
return await this.client.reportStory(chatId, storyId, params);
|
|
1275
|
+
}
|
|
1276
|
+
/** Context-aware alias for {@link Client.requestSecretChat}. */
|
|
1277
|
+
async requestSecretChat() {
|
|
1278
|
+
const chatId = this.#mustGetChatId();
|
|
1279
|
+
return await this.client.requestSecretChat(chatId);
|
|
1280
|
+
}
|
|
1140
1281
|
/** Context-aware alias for {@link Client.resumeBusinessBotConnection}. */
|
|
1141
1282
|
async resumeBusinessBotConnection() {
|
|
1142
1283
|
const chatId = this.#mustGetChatId();
|
|
1143
1284
|
return await this.client.resumeBusinessBotConnection(chatId);
|
|
1144
1285
|
}
|
|
1286
|
+
/** Context-aware alias for {@link Client.retractVote}. */
|
|
1287
|
+
async retractVote(messageId) {
|
|
1288
|
+
const chatId = this.#mustGetChatId();
|
|
1289
|
+
return await this.client.retractVote(chatId, messageId);
|
|
1290
|
+
}
|
|
1145
1291
|
/** Context-aware alias for {@link Client.scheduleVideoChat}. */
|
|
1146
1292
|
async scheduleVideoChat(startAt, params) {
|
|
1147
1293
|
const chatId = this.#mustGetChatId();
|
|
@@ -1164,6 +1310,26 @@ export class Context {
|
|
|
1164
1310
|
const chatId = this.#mustGetChatId();
|
|
1165
1311
|
return await this.client.sendScheduledMessage(chatId, messageId);
|
|
1166
1312
|
}
|
|
1313
|
+
/** Context-aware alias for {@link Client.sendScheduledMessages}. */
|
|
1314
|
+
async sendScheduledMessages(messageIds) {
|
|
1315
|
+
const chatId = this.#mustGetChatId();
|
|
1316
|
+
return await this.client.sendScheduledMessages(chatId, messageIds);
|
|
1317
|
+
}
|
|
1318
|
+
/** Context-aware alias for {@link Client.sendScreenshotNotification}. */
|
|
1319
|
+
async sendScreenshotNotification(replyToMessageId) {
|
|
1320
|
+
const chatId = this.#mustGetChatId();
|
|
1321
|
+
return await this.client.sendScreenshotNotification(chatId, replyToMessageId);
|
|
1322
|
+
}
|
|
1323
|
+
/** Context-aware alias for {@link Client.sendSecretChatAction}. */
|
|
1324
|
+
async sendSecretChatAction(action) {
|
|
1325
|
+
const chatId = this.#mustGetSecretChatId();
|
|
1326
|
+
return await this.client.sendSecretChatAction(chatId, action);
|
|
1327
|
+
}
|
|
1328
|
+
/** Context-aware alias for {@link Client.sendSecretScreenshotNotification}. */
|
|
1329
|
+
async sendSecretScreenshotNotification(messageIds) {
|
|
1330
|
+
const id = this.#mustGetSecretChatId();
|
|
1331
|
+
return await this.client.sendSecretScreenshotNotification(id, messageIds);
|
|
1332
|
+
}
|
|
1167
1333
|
/** Context-aware alias for {@link Client.setAvailableReactions}. */
|
|
1168
1334
|
async setAvailableReactions(availableReactions) {
|
|
1169
1335
|
const chatId = this.#mustGetChatId();
|
|
@@ -1199,6 +1365,11 @@ export class Context {
|
|
|
1199
1365
|
const chatId = this.#mustGetChatId();
|
|
1200
1366
|
return await this.client.setChatTitle(chatId, title);
|
|
1201
1367
|
}
|
|
1368
|
+
/** Context-aware alias for {@link Client.setDefaultSendAs}. */
|
|
1369
|
+
async setDefaultSendAs(sendAs) {
|
|
1370
|
+
const chatId = this.#mustGetChatId();
|
|
1371
|
+
return await this.client.setDefaultSendAs(chatId, sendAs);
|
|
1372
|
+
}
|
|
1202
1373
|
/** Context-aware alias for {@link Client.setDiscussionChat}. */
|
|
1203
1374
|
async setDiscussionChat(discussionChatId) {
|
|
1204
1375
|
const chatId = this.#mustGetChatId();
|
|
@@ -1235,6 +1406,11 @@ export class Context {
|
|
|
1235
1406
|
const chatId = this.#mustGetChatId();
|
|
1236
1407
|
return await this.client.setSlowMode(chatId, duration);
|
|
1237
1408
|
}
|
|
1409
|
+
/** Context-aware alias for {@link Client.setStoryAlbumName}. */
|
|
1410
|
+
async setStoryAlbumName(albumId, name) {
|
|
1411
|
+
const chatId = this.#mustGetChatId();
|
|
1412
|
+
return await this.client.setStoryAlbumName(chatId, albumId, name);
|
|
1413
|
+
}
|
|
1238
1414
|
/** Context-aware alias for {@link Client.showGeneralTopic}. */
|
|
1239
1415
|
async showGeneralTopic() {
|
|
1240
1416
|
const chatId = this.#mustGetChatId();
|
|
@@ -1255,16 +1431,36 @@ export class Context {
|
|
|
1255
1431
|
const chatId = this.#mustGetChatId();
|
|
1256
1432
|
return await this.client.stopPoll(chatId, messageId, params);
|
|
1257
1433
|
}
|
|
1434
|
+
/** Context-aware alias for {@link Client.summarizeText}. */
|
|
1435
|
+
async summarizeText(messageId, params) {
|
|
1436
|
+
const chatId = this.#mustGetChatId();
|
|
1437
|
+
return await this.client.summarizeText(chatId, messageId, params);
|
|
1438
|
+
}
|
|
1258
1439
|
/** Context-aware alias for {@link Client.transcribeVoice}. */
|
|
1259
1440
|
async transcribeVoice(messageId) {
|
|
1260
1441
|
const chatId = this.#mustGetChatId();
|
|
1261
1442
|
return await this.client.transcribeVoice(chatId, messageId);
|
|
1262
1443
|
}
|
|
1444
|
+
/** Context-aware alias for {@link Client.transferGift}. */
|
|
1445
|
+
async transferGift(gift) {
|
|
1446
|
+
const chatId = this.#mustGetChatId();
|
|
1447
|
+
return await this.client.transferGift(chatId, gift);
|
|
1448
|
+
}
|
|
1263
1449
|
/** Context-aware alias for {@link Client.transferChatOwnership}. */
|
|
1264
1450
|
async transferOwnership(userId, password) {
|
|
1265
1451
|
const chatId = this.#mustGetChatId();
|
|
1266
1452
|
return await this.client.transferChatOwnership(chatId, userId, password);
|
|
1267
1453
|
}
|
|
1454
|
+
/** Context-aware alias for {@link Client.translateMessage}. */
|
|
1455
|
+
async translateMessage(toLanguage, messageId, params) {
|
|
1456
|
+
const chatId = this.#mustGetChatId();
|
|
1457
|
+
return await this.client.translateMessage(toLanguage, chatId, messageId, params);
|
|
1458
|
+
}
|
|
1459
|
+
/** Context-aware alias for {@link Client.translateMessages}. */
|
|
1460
|
+
async translateMessages(toLanguage, messageIds, params) {
|
|
1461
|
+
const chatId = this.#mustGetChatId();
|
|
1462
|
+
return await this.client.translateMessages(toLanguage, chatId, messageIds, params);
|
|
1463
|
+
}
|
|
1268
1464
|
/** Context-aware alias for {@link Client.unarchiveChat}. */
|
|
1269
1465
|
async unarchive() {
|
|
1270
1466
|
const chatId = this.#mustGetChatId();
|
|
@@ -1314,4 +1510,19 @@ export class Context {
|
|
|
1314
1510
|
const chatId = this.#mustGetChatId();
|
|
1315
1511
|
return await this.client.updateChecklist(chatId, messageId, params);
|
|
1316
1512
|
}
|
|
1513
|
+
/** Context-aware alias for {@link Client.viewMessage}. */
|
|
1514
|
+
async viewMessage(messageId) {
|
|
1515
|
+
const chatId = this.#mustGetChatId();
|
|
1516
|
+
return await this.client.viewMessage(chatId, messageId);
|
|
1517
|
+
}
|
|
1518
|
+
/** Context-aware alias for {@link Client.viewMessages}. */
|
|
1519
|
+
async viewMessages(messageIds) {
|
|
1520
|
+
const chatId = this.#mustGetChatId();
|
|
1521
|
+
return await this.client.viewMessages(chatId, messageIds);
|
|
1522
|
+
}
|
|
1523
|
+
/** Context-aware alias for {@link Client.vote}. */
|
|
1524
|
+
async vote(messageId, optionIndexes) {
|
|
1525
|
+
const chatId = this.#mustGetChatId();
|
|
1526
|
+
return await this.client.vote(chatId, messageId, optionIndexes);
|
|
1527
|
+
}
|
|
1317
1528
|
}
|