@mtkruto/node 0.180.0 → 0.190.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 +3 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +3 -0
- package/esm/client/0_params.d.ts +44 -38
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +51 -5
- 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.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +20 -14
- package/esm/client/3_account_manager.d.ts +2 -0
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +10 -0
- package/esm/client/3_message_manager.d.ts +1 -0
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +26 -19
- package/esm/client/3_secret_chat_manager.d.ts +3 -2
- package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
- package/esm/client/3_secret_chat_manager.js +53 -10
- 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 +126 -32
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +321 -77
- 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 +53 -5
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +63 -3
- package/esm/client/6_client_dispatcher.d.ts +51 -5
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +61 -3
- 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/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_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_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/B_update.d.ts +9 -9
- package/esm/types/B_update.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/3_types.d.ts +3 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +3 -0
- package/script/client/0_params.d.ts +44 -38
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +51 -5
- 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.d.ts.map +1 -1
- package/script/client/2_file_manager.js +20 -14
- package/script/client/3_account_manager.d.ts +2 -0
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +10 -0
- package/script/client/3_message_manager.d.ts +1 -0
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +25 -18
- package/script/client/3_secret_chat_manager.d.ts +3 -2
- package/script/client/3_secret_chat_manager.d.ts.map +1 -1
- package/script/client/3_secret_chat_manager.js +50 -7
- 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 +126 -32
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +321 -77
- 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 +53 -5
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +63 -3
- package/script/client/6_client_dispatcher.d.ts +51 -5
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +61 -3
- 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/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_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_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/B_update.d.ts +9 -9
- package/script/types/B_update.d.ts.map +1 -1
|
@@ -371,6 +371,11 @@ class Context {
|
|
|
371
371
|
return this.update;
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
+
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
375
|
+
async acceptSecretChat() {
|
|
376
|
+
const id = this.#mustGetSecretChatId();
|
|
377
|
+
return await this.client.acceptSecretChat(id);
|
|
378
|
+
}
|
|
374
379
|
/** Context-aware alias for {@link Client.addContact}. */
|
|
375
380
|
async addAsContact(firstName, params) {
|
|
376
381
|
const chatId = this.#mustGetChatId();
|
|
@@ -386,16 +391,31 @@ class Context {
|
|
|
386
391
|
const chatId = this.#mustGetChatId();
|
|
387
392
|
return await this.client.addChatMembers(chatId, userIds);
|
|
388
393
|
}
|
|
394
|
+
/** Context-aware alias for {@link Client.addPollOption}. */
|
|
395
|
+
async addPollOption(messageId, option) {
|
|
396
|
+
const chatId = this.#mustGetChatId();
|
|
397
|
+
return await this.client.addPollOption(chatId, messageId, option);
|
|
398
|
+
}
|
|
389
399
|
/** Context-aware alias for {@link Client.addReaction}. */
|
|
390
400
|
async addReaction(messageId, reaction, params) {
|
|
391
401
|
const chatId = this.#mustGetChatId();
|
|
392
402
|
return await this.client.addReaction(chatId, messageId, reaction, params);
|
|
393
403
|
}
|
|
404
|
+
/** Context-aware alias for {@link Client.addStoriesToAlbum}. */
|
|
405
|
+
async addStoriesToAlbum(albumId, storyIds) {
|
|
406
|
+
const chatId = this.#mustGetChatId();
|
|
407
|
+
return await this.client.addStoriesToAlbum(chatId, albumId, storyIds);
|
|
408
|
+
}
|
|
394
409
|
/** Context-aware alias for {@link Client.addStoriesToHighlights}. */
|
|
395
410
|
async addStoriesToHighlights(storyIds) {
|
|
396
411
|
const chatId = this.#mustGetChatId();
|
|
397
412
|
return await this.client.addStoriesToHighlights(chatId, storyIds);
|
|
398
413
|
}
|
|
414
|
+
/** Context-aware alias for {@link Client.addStoryToAlbum}. */
|
|
415
|
+
async addStoryToAlbum(albumId, storyId) {
|
|
416
|
+
const chatId = this.#mustGetChatId();
|
|
417
|
+
return await this.client.addStoryToAlbum(chatId, albumId, storyId);
|
|
418
|
+
}
|
|
399
419
|
/** Context-aware alias for {@link Client.addStoryToHighlights}. */
|
|
400
420
|
async addStoryToHighlights(storyId) {
|
|
401
421
|
const chatId = this.#mustGetChatId();
|
|
@@ -499,6 +519,11 @@ class Context {
|
|
|
499
519
|
const chatId = this.#mustGetChatId();
|
|
500
520
|
return await this.client.createStory(chatId, content, params);
|
|
501
521
|
}
|
|
522
|
+
/** Context-aware alias for {@link Client.createStoryAlbum}. */
|
|
523
|
+
async createStoryAlbum(name, storyIds) {
|
|
524
|
+
const chatId = this.#mustGetChatId();
|
|
525
|
+
return await this.client.createStoryAlbum(chatId, name, storyIds);
|
|
526
|
+
}
|
|
502
527
|
/** Context-aware alias for {@link Client.createTopic}. */
|
|
503
528
|
async createTopic(title, params) {
|
|
504
529
|
const chatId = this.#mustGetChatId();
|
|
@@ -517,11 +542,6 @@ class Context {
|
|
|
517
542
|
const chatId = this.#mustGetChatId();
|
|
518
543
|
return await this.client.declineJoinRequests(chatId, params);
|
|
519
544
|
}
|
|
520
|
-
/** Context-aware alias for {@link Client.deleteChatPhoto}. */
|
|
521
|
-
async deleteChatPhoto() {
|
|
522
|
-
const chatId = this.#mustGetChatId();
|
|
523
|
-
return await this.client.deleteChatPhoto(chatId);
|
|
524
|
-
}
|
|
525
545
|
/** Context-aware alias for {@link Client.deleteMessage}. */
|
|
526
546
|
async delete() {
|
|
527
547
|
const { chatId, messageId } = this.#mustGetMsg();
|
|
@@ -537,6 +557,11 @@ class Context {
|
|
|
537
557
|
const chatId = this.#mustGetChatId();
|
|
538
558
|
return await this.client.deleteChatMemberMessages(chatId, userId);
|
|
539
559
|
}
|
|
560
|
+
/** Context-aware alias for {@link Client.deleteChatPhoto}. */
|
|
561
|
+
async deleteChatPhoto() {
|
|
562
|
+
const chatId = this.#mustGetChatId();
|
|
563
|
+
return await this.client.deleteChatPhoto(chatId);
|
|
564
|
+
}
|
|
540
565
|
/** Context-aware alias for {@link Client.deleteChatStickerSet}. */
|
|
541
566
|
async deleteChatStickerSet() {
|
|
542
567
|
const chatId = this.#mustGetChatId();
|
|
@@ -582,6 +607,11 @@ class Context {
|
|
|
582
607
|
const chatId = this.#mustGetChatId();
|
|
583
608
|
return await this.client.disableBusinessBots(chatId);
|
|
584
609
|
}
|
|
610
|
+
/** Context-aware alias for {@link Client.disableChatHistoryForNewMembers}. */
|
|
611
|
+
async disableChatHistoryForNewMembers() {
|
|
612
|
+
const chatId = this.#mustGetChatId();
|
|
613
|
+
return await this.client.disableChatHistoryForNewMembers(chatId);
|
|
614
|
+
}
|
|
585
615
|
/** Context-aware alias for {@link Client.disableJoinRequests}. */
|
|
586
616
|
async disableJoinRequests() {
|
|
587
617
|
const chatId = this.#mustGetChatId();
|
|
@@ -627,16 +657,16 @@ class Context {
|
|
|
627
657
|
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
628
658
|
return await this.client.editInlineMessageReplyMarkup(inlineMessageId, params);
|
|
629
659
|
}
|
|
630
|
-
/** Context-aware alias for {@link Client.editInlineMessageText}. */
|
|
631
|
-
async editInlineMessageText(text, params) {
|
|
632
|
-
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
633
|
-
return await this.client.editInlineMessageText(inlineMessageId, text, params);
|
|
634
|
-
}
|
|
635
660
|
/** Context-aware alias for {@link Client.editInlineMessageRichText}. */
|
|
636
661
|
async editInlineMessageRichText(richText, params) {
|
|
637
662
|
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
638
663
|
return await this.client.editInlineMessageRichText(inlineMessageId, richText, params);
|
|
639
664
|
}
|
|
665
|
+
/** Context-aware alias for {@link Client.editInlineMessageText}. */
|
|
666
|
+
async editInlineMessageText(text, params) {
|
|
667
|
+
const inlineMessageId = this.#mustGetInlineMsgId();
|
|
668
|
+
return await this.client.editInlineMessageText(inlineMessageId, text, params);
|
|
669
|
+
}
|
|
640
670
|
/** Context-aware alias for {@link Client.editMessageCaption}. */
|
|
641
671
|
async editMessageCaption(messageId, params) {
|
|
642
672
|
const chatId = this.#mustGetChatId();
|
|
@@ -657,21 +687,16 @@ class Context {
|
|
|
657
687
|
const chatId = this.#mustGetChatId();
|
|
658
688
|
return await this.client.editMessageReplyMarkup(chatId, messageId, params);
|
|
659
689
|
}
|
|
660
|
-
/** Context-aware alias for {@link Client.editMessageText}. */
|
|
661
|
-
async editMessageText(messageId, text, params) {
|
|
662
|
-
const chatId = this.#mustGetChatId();
|
|
663
|
-
return await this.client.editMessageText(chatId, messageId, text, params);
|
|
664
|
-
}
|
|
665
|
-
/** Context-aware alias for {@link Client.getRichText}. */
|
|
666
|
-
async getRichText(messageId) {
|
|
667
|
-
const chatId = this.#mustGetChatId();
|
|
668
|
-
return await this.client.getRichText(chatId, messageId);
|
|
669
|
-
}
|
|
670
690
|
/** Context-aware alias for {@link Client.editMessageRichText}. */
|
|
671
691
|
async editMessageRichText(messageId, richText, params) {
|
|
672
692
|
const chatId = this.#mustGetChatId();
|
|
673
693
|
return await this.client.editMessageRichText(chatId, messageId, richText, params);
|
|
674
694
|
}
|
|
695
|
+
/** Context-aware alias for {@link Client.editMessageText}. */
|
|
696
|
+
async editMessageText(messageId, text, params) {
|
|
697
|
+
const chatId = this.#mustGetChatId();
|
|
698
|
+
return await this.client.editMessageText(chatId, messageId, text, params);
|
|
699
|
+
}
|
|
675
700
|
/** Context-aware alias for {@link Client.editTopic}. */
|
|
676
701
|
async editTopic(topicId, title, params) {
|
|
677
702
|
const chatId = this.#mustGetChatId();
|
|
@@ -687,6 +712,11 @@ class Context {
|
|
|
687
712
|
const chatId = this.#mustGetChatId();
|
|
688
713
|
return await this.client.enableBusinessBots(chatId);
|
|
689
714
|
}
|
|
715
|
+
/** Context-aware alias for {@link Client.enableChatHistoryForNewMembers}. */
|
|
716
|
+
async enableChatHistoryForNewMembers() {
|
|
717
|
+
const chatId = this.#mustGetChatId();
|
|
718
|
+
return await this.client.enableChatHistoryForNewMembers(chatId);
|
|
719
|
+
}
|
|
690
720
|
/** Context-aware alias for {@link Client.enableJoinRequests}. */
|
|
691
721
|
async enableJoinRequests() {
|
|
692
722
|
const chatId = this.#mustGetChatId();
|
|
@@ -707,6 +737,11 @@ class Context {
|
|
|
707
737
|
const chatId = this.#mustGetChatId();
|
|
708
738
|
return await this.client.enableTopics(chatId, isShownAsTabs);
|
|
709
739
|
}
|
|
740
|
+
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
741
|
+
async endSecretChat(params) {
|
|
742
|
+
const id = this.#mustGetSecretChatId();
|
|
743
|
+
return await this.client.endSecretChat(id, params);
|
|
744
|
+
}
|
|
710
745
|
/** Context-aware alias for {@link Client.forwardMessage}. */
|
|
711
746
|
async forward(to, params) {
|
|
712
747
|
const { chatId, messageId } = this.#mustGetMsg();
|
|
@@ -785,21 +820,56 @@ class Context {
|
|
|
785
820
|
const chatId = this.#mustGetChatId();
|
|
786
821
|
return await this.client.getMessage(chatId, messageId);
|
|
787
822
|
}
|
|
823
|
+
/** Context-aware alias for {@link Client.getMessageCounters}. */
|
|
824
|
+
async getMessageCounters(messageId) {
|
|
825
|
+
const chatId = this.#mustGetChatId();
|
|
826
|
+
return await this.client.getMessageCounters(chatId, messageId);
|
|
827
|
+
}
|
|
788
828
|
/** Context-aware alias for {@link Client.getMessageReactions}. */
|
|
789
829
|
async getMessageReactions(messageId) {
|
|
790
830
|
const chatId = this.#mustGetChatId();
|
|
791
831
|
return await this.client.getMessageReactions(chatId, messageId);
|
|
792
832
|
}
|
|
833
|
+
/** Context-aware alias for {@link Client.getMessageReadDate}. */
|
|
834
|
+
async getMessageReadDate(messageId) {
|
|
835
|
+
const chatId = this.#mustGetChatId();
|
|
836
|
+
return await this.client.getMessageReadDate(chatId, messageId);
|
|
837
|
+
}
|
|
793
838
|
/** Context-aware alias for {@link Client.getMessages}. */
|
|
794
839
|
async getMessages(messageIds) {
|
|
795
840
|
const chatId = this.#mustGetChatId();
|
|
796
841
|
return await this.client.getMessages(chatId, messageIds);
|
|
797
842
|
}
|
|
843
|
+
/** Context-aware alias for {@link Client.getMessagesCounters}. */
|
|
844
|
+
async getMessagesCounters(messageIds) {
|
|
845
|
+
const chatId = this.#mustGetChatId();
|
|
846
|
+
return await this.client.getMessagesCounters(chatId, messageIds);
|
|
847
|
+
}
|
|
848
|
+
/** Context-aware alias for {@link Client.getOnlineCount}. */
|
|
849
|
+
async getOnlineCount() {
|
|
850
|
+
const chatId = this.#mustGetChatId();
|
|
851
|
+
return await this.client.getOnlineCount(chatId);
|
|
852
|
+
}
|
|
853
|
+
/** Context-aware alias for {@link Client.getPollVoters}. */
|
|
854
|
+
async getPollVoters(messageId, params) {
|
|
855
|
+
const chatId = this.#mustGetChatId();
|
|
856
|
+
return await this.client.getPollVoters(chatId, messageId, params);
|
|
857
|
+
}
|
|
858
|
+
/** Context-aware alias for {@link Client.getRichText}. */
|
|
859
|
+
async getRichText(messageId) {
|
|
860
|
+
const chatId = this.#mustGetChatId();
|
|
861
|
+
return await this.client.getRichText(chatId, messageId);
|
|
862
|
+
}
|
|
798
863
|
/** Context-aware alias for {@link Client.getSavedMessages}. */
|
|
799
864
|
async getSavedMessages(params) {
|
|
800
865
|
const chatId = this.#mustGetChatId();
|
|
801
866
|
return await this.client.getSavedMessages(chatId, params);
|
|
802
867
|
}
|
|
868
|
+
/** Context-aware alias for {@link Client.getScheduledMessages}. */
|
|
869
|
+
async getScheduledMessages() {
|
|
870
|
+
const chatId = this.#mustGetChatId();
|
|
871
|
+
return await this.client.getScheduledMessages(chatId);
|
|
872
|
+
}
|
|
803
873
|
/** Context-aware alias for {@link Client.getSimilarBots}. */
|
|
804
874
|
async getSimilarBots() {
|
|
805
875
|
const chatId = this.#mustGetChatId();
|
|
@@ -810,16 +880,41 @@ class Context {
|
|
|
810
880
|
const chatId = this.#mustGetChatId();
|
|
811
881
|
return await this.client.getSimilarChannels(chatId);
|
|
812
882
|
}
|
|
883
|
+
/** Context-aware alias for {@link Client.getStarBalance}. */
|
|
884
|
+
async getStarBalance() {
|
|
885
|
+
const chatId = this.#mustGetChatId();
|
|
886
|
+
return await this.client.getStarBalance(chatId);
|
|
887
|
+
}
|
|
888
|
+
/** Context-aware alias for {@link Client.getStarTransactions}. */
|
|
889
|
+
async getStarTransactions(params) {
|
|
890
|
+
const chatId = this.#mustGetChatId();
|
|
891
|
+
return await this.client.getStarTransactions(chatId, params);
|
|
892
|
+
}
|
|
813
893
|
/** Context-aware alias for {@link Client.getStories}. */
|
|
814
894
|
async getStories(storyIds) {
|
|
815
895
|
const chatId = this.#mustGetChatId();
|
|
816
896
|
return await this.client.getStories(chatId, storyIds);
|
|
817
897
|
}
|
|
898
|
+
/** Context-aware alias for {@link Client.getStoriesInAlbum}. */
|
|
899
|
+
async getStoriesInAlbum(albumId) {
|
|
900
|
+
const chatId = this.#mustGetChatId();
|
|
901
|
+
return await this.client.getStoriesInAlbum(chatId, albumId);
|
|
902
|
+
}
|
|
818
903
|
/** Context-aware alias for {@link Client.getStory}. */
|
|
819
904
|
async getStory(storyId) {
|
|
820
905
|
const chatId = this.#mustGetChatId();
|
|
821
906
|
return await this.client.getStory(chatId, storyId);
|
|
822
907
|
}
|
|
908
|
+
/** Context-aware alias for {@link Client.getStoryAlbums}. */
|
|
909
|
+
async getStoryAlbums() {
|
|
910
|
+
const chatId = this.#mustGetChatId();
|
|
911
|
+
return await this.client.getStoryAlbums(chatId);
|
|
912
|
+
}
|
|
913
|
+
/** Context-aware alias for {@link Client.getTonBalance}. */
|
|
914
|
+
async getTonBalance() {
|
|
915
|
+
const chatId = this.#mustGetChatId();
|
|
916
|
+
return await this.client.getTonBalance(chatId);
|
|
917
|
+
}
|
|
823
918
|
/** Context-aware alias for {@link Client.sendGift}. */
|
|
824
919
|
async gift(giftId, params) {
|
|
825
920
|
const chatId = this.#mustGetChatId();
|
|
@@ -835,6 +930,11 @@ class Context {
|
|
|
835
930
|
const chatId = this.#mustGetChatId();
|
|
836
931
|
return await this.client.hideMemberList(chatId);
|
|
837
932
|
}
|
|
933
|
+
/** Context-aware alias for {@link Client.joinChat}. */
|
|
934
|
+
async joinChat() {
|
|
935
|
+
const chatId = this.#mustGetChatId();
|
|
936
|
+
return await this.client.joinChat(chatId);
|
|
937
|
+
}
|
|
838
938
|
/** Context-aware alias for {@link Client.kickChatMember}. */
|
|
839
939
|
async kickChatMember(memberId) {
|
|
840
940
|
const chatId = this.#mustGetChatId();
|
|
@@ -853,6 +953,16 @@ class Context {
|
|
|
853
953
|
const chatId = this.#mustGetChatId();
|
|
854
954
|
return await this.client.leaveChat(chatId);
|
|
855
955
|
}
|
|
956
|
+
/** Context-aware alias for {@link Client.markChatAsRead}. */
|
|
957
|
+
async markChatAsRead() {
|
|
958
|
+
const chatId = this.#mustGetChatId();
|
|
959
|
+
return await this.client.markChatAsRead(chatId);
|
|
960
|
+
}
|
|
961
|
+
/** Context-aware alias for {@link Client.markChatAsUnread}. */
|
|
962
|
+
async markChatAsUnread() {
|
|
963
|
+
const chatId = this.#mustGetChatId();
|
|
964
|
+
return await this.client.markChatAsUnread(chatId);
|
|
965
|
+
}
|
|
856
966
|
/** Context-aware alias for {@link Client.openChat}. */
|
|
857
967
|
async open() {
|
|
858
968
|
const chatId = this.#mustGetChatId();
|
|
@@ -903,74 +1013,55 @@ class Context {
|
|
|
903
1013
|
const chatId = this.#mustGetChatId();
|
|
904
1014
|
return await this.client.deleteContact(chatId);
|
|
905
1015
|
}
|
|
1016
|
+
/** Context-aware alias for {@link Client.removePollOption}. */
|
|
1017
|
+
async removePollOption(messageId, optionIndex) {
|
|
1018
|
+
const chatId = this.#mustGetChatId();
|
|
1019
|
+
return await this.client.removePollOption(chatId, messageId, optionIndex);
|
|
1020
|
+
}
|
|
906
1021
|
/** Context-aware alias for {@link Client.removeReaction}. */
|
|
907
1022
|
async removeReaction(messageId, reaction) {
|
|
908
1023
|
const chatId = this.#mustGetChatId();
|
|
909
1024
|
return await this.client.removeReaction(chatId, messageId, reaction);
|
|
910
1025
|
}
|
|
911
|
-
/** Context-aware alias for {@link Client.
|
|
912
|
-
async
|
|
913
|
-
const chatId = this.#mustGetChatId();
|
|
914
|
-
return await this.client.removeUserReaction(chatId, messageId, userId);
|
|
915
|
-
}
|
|
916
|
-
/** Context-aware alias for {@link Client.removeUserReactions}. */
|
|
917
|
-
async removeUserReactions(userId) {
|
|
1026
|
+
/** Context-aware alias for {@link Client.removeStoriesFromAlbum}. */
|
|
1027
|
+
async removeStoriesFromAlbum(albumId, storyIds) {
|
|
918
1028
|
const chatId = this.#mustGetChatId();
|
|
919
|
-
return await this.client.
|
|
1029
|
+
return await this.client.removeStoriesFromAlbum(chatId, albumId, storyIds);
|
|
920
1030
|
}
|
|
921
1031
|
/** Context-aware alias for {@link Client.removeStoriesFromHighlights}. */
|
|
922
1032
|
async removeStoriesFromHighlights(storyIds) {
|
|
923
1033
|
const chatId = this.#mustGetChatId();
|
|
924
1034
|
return await this.client.removeStoriesFromHighlights(chatId, storyIds);
|
|
925
1035
|
}
|
|
1036
|
+
/** Context-aware alias for {@link Client.removeStoryFromAlbum}. */
|
|
1037
|
+
async removeStoryFromAlbum(albumId, storyId) {
|
|
1038
|
+
const chatId = this.#mustGetChatId();
|
|
1039
|
+
return await this.client.removeStoryFromAlbum(chatId, albumId, storyId);
|
|
1040
|
+
}
|
|
926
1041
|
/** Context-aware alias for {@link Client.removeStoryFromHighlights}. */
|
|
927
1042
|
async removeStoryFromHighlights(storyId) {
|
|
928
1043
|
const chatId = this.#mustGetChatId();
|
|
929
1044
|
return await this.client.removeStoryFromHighlights(chatId, storyId);
|
|
930
1045
|
}
|
|
1046
|
+
/** Context-aware alias for {@link Client.removeUserReaction}. */
|
|
1047
|
+
async removeUserReaction(messageId, userId) {
|
|
1048
|
+
const chatId = this.#mustGetChatId();
|
|
1049
|
+
return await this.client.removeUserReaction(chatId, messageId, userId);
|
|
1050
|
+
}
|
|
1051
|
+
/** Context-aware alias for {@link Client.removeUserReactions}. */
|
|
1052
|
+
async removeUserReactions(userId) {
|
|
1053
|
+
const chatId = this.#mustGetChatId();
|
|
1054
|
+
return await this.client.removeUserReactions(chatId, userId);
|
|
1055
|
+
}
|
|
931
1056
|
/** Context-aware alias for {@link Client.reopenTopic}. */
|
|
932
1057
|
async reopenTopic(topicId) {
|
|
933
1058
|
const chatId = this.#mustGetChatId();
|
|
934
1059
|
return await this.client.reopenTopic(chatId, topicId);
|
|
935
1060
|
}
|
|
936
|
-
/** Context-aware alias for {@link Client.
|
|
937
|
-
async
|
|
938
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
939
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
940
|
-
return await this.client.sendSecretMessage(chatId, text, { ...params, replyToMessageId });
|
|
941
|
-
}
|
|
942
|
-
/** Context-aware alias for {@link Client.sendSecretLocation}. */
|
|
943
|
-
async replySecretLocation(latitude, longitude, params) {
|
|
944
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
945
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
946
|
-
return await this.client.sendSecretLocation(chatId, latitude, longitude, { ...params, replyToMessageId });
|
|
947
|
-
}
|
|
948
|
-
/** Context-aware alias for {@link Client.sendSecretVenue}. */
|
|
949
|
-
async replySecretVenue(latitude, longitude, title, address, params) {
|
|
950
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
951
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
952
|
-
return await this.client.sendSecretVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId });
|
|
953
|
-
}
|
|
954
|
-
/** Context-aware alias for {@link Client.sendSecretContact}. */
|
|
955
|
-
async replySecretContact(firstName, phoneNumber, params) {
|
|
956
|
-
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
957
|
-
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
958
|
-
return await this.client.sendSecretContact(chatId, firstName, phoneNumber, { ...params, replyToMessageId });
|
|
959
|
-
}
|
|
960
|
-
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
961
|
-
async acceptSecretChat() {
|
|
962
|
-
const id = this.#mustGetSecretChatId();
|
|
963
|
-
return await this.client.acceptSecretChat(id);
|
|
964
|
-
}
|
|
965
|
-
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
966
|
-
async endSecretChat(params) {
|
|
967
|
-
const id = this.#mustGetSecretChatId();
|
|
968
|
-
return await this.client.endSecretChat(id, params);
|
|
969
|
-
}
|
|
970
|
-
/** Context-aware alias for {@link Client.requestSecretChat}. */
|
|
971
|
-
async requestSecretChat() {
|
|
1061
|
+
/** Context-aware alias for {@link Client.reorderStoriesInAlbum}. */
|
|
1062
|
+
async reorderStoriesInAlbum(albumId, storyIds) {
|
|
972
1063
|
const chatId = this.#mustGetChatId();
|
|
973
|
-
return await this.client.
|
|
1064
|
+
return await this.client.reorderStoriesInAlbum(chatId, albumId, storyIds);
|
|
974
1065
|
}
|
|
975
1066
|
/** Context-aware alias for {@link Client.sendMessage}. */
|
|
976
1067
|
async reply(text, params) {
|
|
@@ -978,12 +1069,6 @@ class Context {
|
|
|
978
1069
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
979
1070
|
return await this.client.sendMessage(chatId, text, { ...params, ...replyTo, businessConnectionId });
|
|
980
1071
|
}
|
|
981
|
-
/** Context-aware alias for {@link Client.sendRichText}. */
|
|
982
|
-
async replyRichText(richText, params) {
|
|
983
|
-
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
984
|
-
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
985
|
-
return await this.client.sendRichText(chatId, richText, { ...params, ...replyTo, businessConnectionId });
|
|
986
|
-
}
|
|
987
1072
|
/** Context-aware alias for {@link Client.sendAnimation}. */
|
|
988
1073
|
async replyAnimation(animation, params) {
|
|
989
1074
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1026,18 +1111,18 @@ class Context {
|
|
|
1026
1111
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1027
1112
|
return await this.client.sendMessageDraft(chatId, draftId, text, { ...params, ...replyTo });
|
|
1028
1113
|
}
|
|
1029
|
-
/** Context-aware alias for {@link Client.sendRichTextDraft}. */
|
|
1030
|
-
async replyRichTextDraft(draftId, richText, params) {
|
|
1031
|
-
const { chatId, messageId } = this.#mustGetMsg();
|
|
1032
|
-
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1033
|
-
return await this.client.sendRichTextDraft(chatId, draftId, richText, { ...params, ...replyTo });
|
|
1034
|
-
}
|
|
1035
1114
|
/** Context-aware alias for {@link Client.sendInvoice}. */
|
|
1036
1115
|
async replyInvoice(title, description, payload, currency, prices, params) {
|
|
1037
1116
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1038
1117
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1039
1118
|
return await this.client.sendInvoice(chatId, title, description, payload, currency, prices, { ...params, ...replyTo, businessConnectionId });
|
|
1040
1119
|
}
|
|
1120
|
+
/** Context-aware alias for {@link Client.sendLivePhoto}. */
|
|
1121
|
+
async replyLivePhoto(photo, video, params) {
|
|
1122
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1123
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1124
|
+
return await this.client.sendLivePhoto(chatId, photo, video, { ...params, ...replyTo, businessConnectionId });
|
|
1125
|
+
}
|
|
1041
1126
|
/** Context-aware alias for {@link Client.sendLocation}. */
|
|
1042
1127
|
async replyLocation(latitude, longitude, params) {
|
|
1043
1128
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1062,6 +1147,90 @@ class Context {
|
|
|
1062
1147
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1063
1148
|
return await this.client.sendPoll(chatId, question, options, { ...params, ...replyTo, businessConnectionId });
|
|
1064
1149
|
}
|
|
1150
|
+
/** Context-aware alias for {@link Client.sendRichText}. */
|
|
1151
|
+
async replyRichText(richText, params) {
|
|
1152
|
+
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1153
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1154
|
+
return await this.client.sendRichText(chatId, richText, { ...params, ...replyTo, businessConnectionId });
|
|
1155
|
+
}
|
|
1156
|
+
/** Context-aware alias for {@link Client.sendRichTextDraft}. */
|
|
1157
|
+
async replyRichTextDraft(draftId, richText, params) {
|
|
1158
|
+
const { chatId, messageId } = this.#mustGetMsg();
|
|
1159
|
+
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1160
|
+
return await this.client.sendRichTextDraft(chatId, draftId, richText, { ...params, ...replyTo });
|
|
1161
|
+
}
|
|
1162
|
+
/** Context-aware alias for {@link Client.sendSecretMessage}. */
|
|
1163
|
+
async replySecret(text, params) {
|
|
1164
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1165
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1166
|
+
return await this.client.sendSecretMessage(chatId, text, { ...params, replyToMessageId });
|
|
1167
|
+
}
|
|
1168
|
+
/** Context-aware alias for {@link Client.sendSecretAnimation}. */
|
|
1169
|
+
async replySecretAnimation(animation, params) {
|
|
1170
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1171
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1172
|
+
return await this.client.sendSecretVideoNote(chatId, animation, { ...params, replyToMessageId });
|
|
1173
|
+
}
|
|
1174
|
+
/** Context-aware alias for {@link Client.sendSecretAudio}. */
|
|
1175
|
+
async replySecretAudio(audio, params) {
|
|
1176
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1177
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1178
|
+
return await this.client.sendSecretAudio(chatId, audio, { ...params, replyToMessageId });
|
|
1179
|
+
}
|
|
1180
|
+
/** Context-aware alias for {@link Client.sendSecretContact}. */
|
|
1181
|
+
async replySecretContact(firstName, phoneNumber, params) {
|
|
1182
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1183
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1184
|
+
return await this.client.sendSecretContact(chatId, firstName, phoneNumber, { ...params, replyToMessageId });
|
|
1185
|
+
}
|
|
1186
|
+
/** Context-aware alias for {@link Client.sendSecretDocument}. */
|
|
1187
|
+
async replySecretDocument(document, params) {
|
|
1188
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1189
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1190
|
+
return await this.client.sendSecretDocument(chatId, document, { ...params, replyToMessageId });
|
|
1191
|
+
}
|
|
1192
|
+
/** Context-aware alias for {@link Client.sendSecretLocation}. */
|
|
1193
|
+
async replySecretLocation(latitude, longitude, params) {
|
|
1194
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1195
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1196
|
+
return await this.client.sendSecretLocation(chatId, latitude, longitude, { ...params, replyToMessageId });
|
|
1197
|
+
}
|
|
1198
|
+
/** Context-aware alias for {@link Client.sendSecretPhoto}. */
|
|
1199
|
+
async replySecretPhoto(photo, params) {
|
|
1200
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1201
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1202
|
+
return await this.client.sendSecretPhoto(chatId, photo, { ...params, replyToMessageId });
|
|
1203
|
+
}
|
|
1204
|
+
/** Context-aware alias for {@link Client.sendSecretSticker}. */
|
|
1205
|
+
async replySecretSticker(sticker, params) {
|
|
1206
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1207
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1208
|
+
return await this.client.sendSecretSticker(chatId, sticker, { ...params, replyToMessageId });
|
|
1209
|
+
}
|
|
1210
|
+
/** Context-aware alias for {@link Client.sendSecretVenue}. */
|
|
1211
|
+
async replySecretVenue(latitude, longitude, title, address, params) {
|
|
1212
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1213
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1214
|
+
return await this.client.sendSecretVenue(chatId, latitude, longitude, title, address, { ...params, replyToMessageId });
|
|
1215
|
+
}
|
|
1216
|
+
/** Context-aware alias for {@link Client.sendSecretVideo}. */
|
|
1217
|
+
async replySecretVideo(video, params) {
|
|
1218
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1219
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1220
|
+
return await this.client.sendSecretVideo(chatId, video, { ...params, replyToMessageId });
|
|
1221
|
+
}
|
|
1222
|
+
/** Context-aware alias for {@link Client.sendSecretVideoNote}. */
|
|
1223
|
+
async replySecretVideoNote(videoNote, params) {
|
|
1224
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1225
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1226
|
+
return await this.client.sendSecretVideoNote(chatId, videoNote, { ...params, replyToMessageId });
|
|
1227
|
+
}
|
|
1228
|
+
/** Context-aware alias for {@link Client.sendSecretVoice}. */
|
|
1229
|
+
async replySecretVoice(voice, params) {
|
|
1230
|
+
const { chatId, messageId } = this.#mustGetSecretMsg();
|
|
1231
|
+
const replyToMessageId = params?.isQuoted ? messageId : undefined;
|
|
1232
|
+
return await this.client.sendSecretVoice(chatId, voice, { ...params, replyToMessageId });
|
|
1233
|
+
}
|
|
1065
1234
|
/** Context-aware alias for {@link Client.sendSticker}. */
|
|
1066
1235
|
async replySticker(sticker, params) {
|
|
1067
1236
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1092,11 +1261,36 @@ class Context {
|
|
|
1092
1261
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1093
1262
|
return await this.client.sendVoice(chatId, voice, { ...params, ...replyTo, businessConnectionId });
|
|
1094
1263
|
}
|
|
1264
|
+
/** Context-aware alias for {@link Client.reportChat}. */
|
|
1265
|
+
async reportChat(reason, params) {
|
|
1266
|
+
const chatId = this.#mustGetChatId();
|
|
1267
|
+
return await this.client.reportChat(chatId, reason, params);
|
|
1268
|
+
}
|
|
1269
|
+
/** Context-aware alias for {@link Client.reportStories}. */
|
|
1270
|
+
async reportStories(storyIds, params) {
|
|
1271
|
+
const chatId = this.#mustGetChatId();
|
|
1272
|
+
return await this.client.reportStories(chatId, storyIds, params);
|
|
1273
|
+
}
|
|
1274
|
+
/** Context-aware alias for {@link Client.reportStory}. */
|
|
1275
|
+
async reportStory(storyId, params) {
|
|
1276
|
+
const chatId = this.#mustGetChatId();
|
|
1277
|
+
return await this.client.reportStory(chatId, storyId, params);
|
|
1278
|
+
}
|
|
1279
|
+
/** Context-aware alias for {@link Client.requestSecretChat}. */
|
|
1280
|
+
async requestSecretChat() {
|
|
1281
|
+
const chatId = this.#mustGetChatId();
|
|
1282
|
+
return await this.client.requestSecretChat(chatId);
|
|
1283
|
+
}
|
|
1095
1284
|
/** Context-aware alias for {@link Client.resumeBusinessBotConnection}. */
|
|
1096
1285
|
async resumeBusinessBotConnection() {
|
|
1097
1286
|
const chatId = this.#mustGetChatId();
|
|
1098
1287
|
return await this.client.resumeBusinessBotConnection(chatId);
|
|
1099
1288
|
}
|
|
1289
|
+
/** Context-aware alias for {@link Client.retractVote}. */
|
|
1290
|
+
async retractVote(messageId) {
|
|
1291
|
+
const chatId = this.#mustGetChatId();
|
|
1292
|
+
return await this.client.retractVote(chatId, messageId);
|
|
1293
|
+
}
|
|
1100
1294
|
/** Context-aware alias for {@link Client.scheduleVideoChat}. */
|
|
1101
1295
|
async scheduleVideoChat(startAt, params) {
|
|
1102
1296
|
const chatId = this.#mustGetChatId();
|
|
@@ -1119,6 +1313,11 @@ class Context {
|
|
|
1119
1313
|
const chatId = this.#mustGetChatId();
|
|
1120
1314
|
return await this.client.sendScheduledMessage(chatId, messageId);
|
|
1121
1315
|
}
|
|
1316
|
+
/** Context-aware alias for {@link Client.sendScheduledMessages}. */
|
|
1317
|
+
async sendScheduledMessages(messageIds) {
|
|
1318
|
+
const chatId = this.#mustGetChatId();
|
|
1319
|
+
return await this.client.sendScheduledMessages(chatId, messageIds);
|
|
1320
|
+
}
|
|
1122
1321
|
/** Context-aware alias for {@link Client.setAvailableReactions}. */
|
|
1123
1322
|
async setAvailableReactions(availableReactions) {
|
|
1124
1323
|
const chatId = this.#mustGetChatId();
|
|
@@ -1154,6 +1353,11 @@ class Context {
|
|
|
1154
1353
|
const chatId = this.#mustGetChatId();
|
|
1155
1354
|
return await this.client.setChatTitle(chatId, title);
|
|
1156
1355
|
}
|
|
1356
|
+
/** Context-aware alias for {@link Client.setDefaultSendAs}. */
|
|
1357
|
+
async setDefaultSendAs(sendAs) {
|
|
1358
|
+
const chatId = this.#mustGetChatId();
|
|
1359
|
+
return await this.client.setDefaultSendAs(chatId, sendAs);
|
|
1360
|
+
}
|
|
1157
1361
|
/** Context-aware alias for {@link Client.setDiscussionChat}. */
|
|
1158
1362
|
async setDiscussionChat(discussionChatId) {
|
|
1159
1363
|
const chatId = this.#mustGetChatId();
|
|
@@ -1190,6 +1394,11 @@ class Context {
|
|
|
1190
1394
|
const chatId = this.#mustGetChatId();
|
|
1191
1395
|
return await this.client.setSlowMode(chatId, duration);
|
|
1192
1396
|
}
|
|
1397
|
+
/** Context-aware alias for {@link Client.setStoryAlbumName}. */
|
|
1398
|
+
async setStoryAlbumName(albumId, name) {
|
|
1399
|
+
const chatId = this.#mustGetChatId();
|
|
1400
|
+
return await this.client.setStoryAlbumName(chatId, albumId, name);
|
|
1401
|
+
}
|
|
1193
1402
|
/** Context-aware alias for {@link Client.showGeneralTopic}. */
|
|
1194
1403
|
async showGeneralTopic() {
|
|
1195
1404
|
const chatId = this.#mustGetChatId();
|
|
@@ -1210,16 +1419,36 @@ class Context {
|
|
|
1210
1419
|
const chatId = this.#mustGetChatId();
|
|
1211
1420
|
return await this.client.stopPoll(chatId, messageId, params);
|
|
1212
1421
|
}
|
|
1422
|
+
/** Context-aware alias for {@link Client.summarizeText}. */
|
|
1423
|
+
async summarizeText(messageId, params) {
|
|
1424
|
+
const chatId = this.#mustGetChatId();
|
|
1425
|
+
return await this.client.summarizeText(chatId, messageId, params);
|
|
1426
|
+
}
|
|
1213
1427
|
/** Context-aware alias for {@link Client.transcribeVoice}. */
|
|
1214
1428
|
async transcribeVoice(messageId) {
|
|
1215
1429
|
const chatId = this.#mustGetChatId();
|
|
1216
1430
|
return await this.client.transcribeVoice(chatId, messageId);
|
|
1217
1431
|
}
|
|
1432
|
+
/** Context-aware alias for {@link Client.transferGift}. */
|
|
1433
|
+
async transferGift(gift) {
|
|
1434
|
+
const chatId = this.#mustGetChatId();
|
|
1435
|
+
return await this.client.transferGift(chatId, gift);
|
|
1436
|
+
}
|
|
1218
1437
|
/** Context-aware alias for {@link Client.transferChatOwnership}. */
|
|
1219
1438
|
async transferOwnership(userId, password) {
|
|
1220
1439
|
const chatId = this.#mustGetChatId();
|
|
1221
1440
|
return await this.client.transferChatOwnership(chatId, userId, password);
|
|
1222
1441
|
}
|
|
1442
|
+
/** Context-aware alias for {@link Client.translateMessage}. */
|
|
1443
|
+
async translateMessage(toLanguage, messageId, params) {
|
|
1444
|
+
const chatId = this.#mustGetChatId();
|
|
1445
|
+
return await this.client.translateMessage(toLanguage, chatId, messageId, params);
|
|
1446
|
+
}
|
|
1447
|
+
/** Context-aware alias for {@link Client.translateMessages}. */
|
|
1448
|
+
async translateMessages(toLanguage, messageIds, params) {
|
|
1449
|
+
const chatId = this.#mustGetChatId();
|
|
1450
|
+
return await this.client.translateMessages(toLanguage, chatId, messageIds, params);
|
|
1451
|
+
}
|
|
1223
1452
|
/** Context-aware alias for {@link Client.unarchiveChat}. */
|
|
1224
1453
|
async unarchive() {
|
|
1225
1454
|
const chatId = this.#mustGetChatId();
|
|
@@ -1269,5 +1498,20 @@ class Context {
|
|
|
1269
1498
|
const chatId = this.#mustGetChatId();
|
|
1270
1499
|
return await this.client.updateChecklist(chatId, messageId, params);
|
|
1271
1500
|
}
|
|
1501
|
+
/** Context-aware alias for {@link Client.viewMessage}. */
|
|
1502
|
+
async viewMessage(messageId) {
|
|
1503
|
+
const chatId = this.#mustGetChatId();
|
|
1504
|
+
return await this.client.viewMessage(chatId, messageId);
|
|
1505
|
+
}
|
|
1506
|
+
/** Context-aware alias for {@link Client.viewMessages}. */
|
|
1507
|
+
async viewMessages(messageIds) {
|
|
1508
|
+
const chatId = this.#mustGetChatId();
|
|
1509
|
+
return await this.client.viewMessages(chatId, messageIds);
|
|
1510
|
+
}
|
|
1511
|
+
/** Context-aware alias for {@link Client.vote}. */
|
|
1512
|
+
async vote(messageId, optionIndexes) {
|
|
1513
|
+
const chatId = this.#mustGetChatId();
|
|
1514
|
+
return await this.client.vote(chatId, messageId, optionIndexes);
|
|
1515
|
+
}
|
|
1272
1516
|
}
|
|
1273
1517
|
exports.Context = Context;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { type ID, type InputPollOption, type Update } from "../3_types.js";
|
|
22
|
+
import type { GetPollVotersParams } from "./0_params.js";
|
|
22
23
|
import type { UpdateProcessor } from "./0_update_processor.js";
|
|
23
24
|
import type { C as C_ } from "./1_types.js";
|
|
24
25
|
import type { FileManager } from "./2_file_manager.js";
|
|
@@ -35,9 +36,10 @@ export declare class PollManager implements UpdateProcessor<PollManagerUpdate, t
|
|
|
35
36
|
vote(chatId: ID, messageId: number, optionIndexes: number[]): Promise<void>;
|
|
36
37
|
retractVote(chatId: ID, messageId: number): Promise<void>;
|
|
37
38
|
addPollOption(chatId: ID, messageId: number, option: InputPollOption): Promise<void>;
|
|
38
|
-
removePollOption(chatId: ID, messageId: number,
|
|
39
|
+
removePollOption(chatId: ID, messageId: number, optionIndex: number): Promise<void>;
|
|
39
40
|
canHandleUpdate(update: Api.Update): update is PollManagerUpdate;
|
|
40
41
|
handleUpdate(update: PollManagerUpdate): Promise<Update | null>;
|
|
42
|
+
getPollVoters(chatId: ID, messageId: number, params?: GetPollVotersParams): Promise<import("../3_types.js").PollVoterList>;
|
|
41
43
|
}
|
|
42
44
|
export {};
|
|
43
45
|
//# sourceMappingURL=4_poll_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_poll_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_poll_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"4_poll_manager.d.ts","sourceRoot":"","sources":["../../src/client/4_poll_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA8D,KAAK,EAAE,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACvI,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,KAAK,CAAC,GAAG,EAAE,GAAG;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,cAAc,EAAE,cAAc,CAAA;CAAE,CAAC;AAE3E,QAAA,MAAM,kBAAkB,yDAGd,CAAC;AAEX,KAAK,iBAAiB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAExE,qBAAa,WAAY,YAAW,eAAe,CAAC,iBAAiB,EAAE,IAAI,CAAC;;gBAG9D,CAAC,EAAE,CAAC;IAIV,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE;IAQ3D,WAAW,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM;IAwCzC,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe;IAWpE,gBAAgB,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAQzE,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,iBAAiB;IAI1D,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAsB/D,aAAa,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB;CAWhF"}
|