@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
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,74 +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
|
|
910
|
-
const chatId = this.#mustGetChatId();
|
|
911
|
-
return await this.client.removeUserReaction(chatId, messageId, userId);
|
|
912
|
-
}
|
|
913
|
-
/** Context-aware alias for {@link Client.removeUserReactions}. */
|
|
914
|
-
async removeUserReactions(userId) {
|
|
1023
|
+
/** Context-aware alias for {@link Client.removeStoriesFromAlbum}. */
|
|
1024
|
+
async removeStoriesFromAlbum(albumId, storyIds) {
|
|
915
1025
|
const chatId = this.#mustGetChatId();
|
|
916
|
-
return await this.client.
|
|
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.acceptSecretChat}. */
|
|
958
|
-
async acceptSecretChat() {
|
|
959
|
-
const id = this.#mustGetSecretChatId();
|
|
960
|
-
return await this.client.acceptSecretChat(id);
|
|
961
|
-
}
|
|
962
|
-
/** Context-aware alias for {@link Client.acceptSecretChat}. */
|
|
963
|
-
async endSecretChat(params) {
|
|
964
|
-
const id = this.#mustGetSecretChatId();
|
|
965
|
-
return await this.client.endSecretChat(id, params);
|
|
966
|
-
}
|
|
967
|
-
/** Context-aware alias for {@link Client.requestSecretChat}. */
|
|
968
|
-
async requestSecretChat() {
|
|
1058
|
+
/** Context-aware alias for {@link Client.reorderStoriesInAlbum}. */
|
|
1059
|
+
async reorderStoriesInAlbum(albumId, storyIds) {
|
|
969
1060
|
const chatId = this.#mustGetChatId();
|
|
970
|
-
return await this.client.
|
|
1061
|
+
return await this.client.reorderStoriesInAlbum(chatId, albumId, storyIds);
|
|
971
1062
|
}
|
|
972
1063
|
/** Context-aware alias for {@link Client.sendMessage}. */
|
|
973
1064
|
async reply(text, params) {
|
|
@@ -975,12 +1066,6 @@ export class Context {
|
|
|
975
1066
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
976
1067
|
return await this.client.sendMessage(chatId, text, { ...params, ...replyTo, businessConnectionId });
|
|
977
1068
|
}
|
|
978
|
-
/** Context-aware alias for {@link Client.sendRichText}. */
|
|
979
|
-
async replyRichText(richText, params) {
|
|
980
|
-
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
981
|
-
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
982
|
-
return await this.client.sendRichText(chatId, richText, { ...params, ...replyTo, businessConnectionId });
|
|
983
|
-
}
|
|
984
1069
|
/** Context-aware alias for {@link Client.sendAnimation}. */
|
|
985
1070
|
async replyAnimation(animation, params) {
|
|
986
1071
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1023,18 +1108,18 @@ export class Context {
|
|
|
1023
1108
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1024
1109
|
return await this.client.sendMessageDraft(chatId, draftId, text, { ...params, ...replyTo });
|
|
1025
1110
|
}
|
|
1026
|
-
/** Context-aware alias for {@link Client.sendRichTextDraft}. */
|
|
1027
|
-
async replyRichTextDraft(draftId, richText, params) {
|
|
1028
|
-
const { chatId, messageId } = this.#mustGetMsg();
|
|
1029
|
-
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1030
|
-
return await this.client.sendRichTextDraft(chatId, draftId, richText, { ...params, ...replyTo });
|
|
1031
|
-
}
|
|
1032
1111
|
/** Context-aware alias for {@link Client.sendInvoice}. */
|
|
1033
1112
|
async replyInvoice(title, description, payload, currency, prices, params) {
|
|
1034
1113
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
1035
1114
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1036
1115
|
return await this.client.sendInvoice(chatId, title, description, payload, currency, prices, { ...params, ...replyTo, businessConnectionId });
|
|
1037
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
|
+
}
|
|
1038
1123
|
/** Context-aware alias for {@link Client.sendLocation}. */
|
|
1039
1124
|
async replyLocation(latitude, longitude, params) {
|
|
1040
1125
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1059,6 +1144,90 @@ export class Context {
|
|
|
1059
1144
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1060
1145
|
return await this.client.sendPoll(chatId, question, options, { ...params, ...replyTo, businessConnectionId });
|
|
1061
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
|
+
}
|
|
1062
1231
|
/** Context-aware alias for {@link Client.sendSticker}. */
|
|
1063
1232
|
async replySticker(sticker, params) {
|
|
1064
1233
|
const { chatId, messageId, businessConnectionId } = this.#mustGetMsg();
|
|
@@ -1089,11 +1258,36 @@ export class Context {
|
|
|
1089
1258
|
const replyTo = this.#getReplyTo(params?.isQuoted, chatId, messageId);
|
|
1090
1259
|
return await this.client.sendVoice(chatId, voice, { ...params, ...replyTo, businessConnectionId });
|
|
1091
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
|
+
}
|
|
1092
1281
|
/** Context-aware alias for {@link Client.resumeBusinessBotConnection}. */
|
|
1093
1282
|
async resumeBusinessBotConnection() {
|
|
1094
1283
|
const chatId = this.#mustGetChatId();
|
|
1095
1284
|
return await this.client.resumeBusinessBotConnection(chatId);
|
|
1096
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
|
+
}
|
|
1097
1291
|
/** Context-aware alias for {@link Client.scheduleVideoChat}. */
|
|
1098
1292
|
async scheduleVideoChat(startAt, params) {
|
|
1099
1293
|
const chatId = this.#mustGetChatId();
|
|
@@ -1116,6 +1310,11 @@ export class Context {
|
|
|
1116
1310
|
const chatId = this.#mustGetChatId();
|
|
1117
1311
|
return await this.client.sendScheduledMessage(chatId, messageId);
|
|
1118
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
|
+
}
|
|
1119
1318
|
/** Context-aware alias for {@link Client.setAvailableReactions}. */
|
|
1120
1319
|
async setAvailableReactions(availableReactions) {
|
|
1121
1320
|
const chatId = this.#mustGetChatId();
|
|
@@ -1151,6 +1350,11 @@ export class Context {
|
|
|
1151
1350
|
const chatId = this.#mustGetChatId();
|
|
1152
1351
|
return await this.client.setChatTitle(chatId, title);
|
|
1153
1352
|
}
|
|
1353
|
+
/** Context-aware alias for {@link Client.setDefaultSendAs}. */
|
|
1354
|
+
async setDefaultSendAs(sendAs) {
|
|
1355
|
+
const chatId = this.#mustGetChatId();
|
|
1356
|
+
return await this.client.setDefaultSendAs(chatId, sendAs);
|
|
1357
|
+
}
|
|
1154
1358
|
/** Context-aware alias for {@link Client.setDiscussionChat}. */
|
|
1155
1359
|
async setDiscussionChat(discussionChatId) {
|
|
1156
1360
|
const chatId = this.#mustGetChatId();
|
|
@@ -1187,6 +1391,11 @@ export class Context {
|
|
|
1187
1391
|
const chatId = this.#mustGetChatId();
|
|
1188
1392
|
return await this.client.setSlowMode(chatId, duration);
|
|
1189
1393
|
}
|
|
1394
|
+
/** Context-aware alias for {@link Client.setStoryAlbumName}. */
|
|
1395
|
+
async setStoryAlbumName(albumId, name) {
|
|
1396
|
+
const chatId = this.#mustGetChatId();
|
|
1397
|
+
return await this.client.setStoryAlbumName(chatId, albumId, name);
|
|
1398
|
+
}
|
|
1190
1399
|
/** Context-aware alias for {@link Client.showGeneralTopic}. */
|
|
1191
1400
|
async showGeneralTopic() {
|
|
1192
1401
|
const chatId = this.#mustGetChatId();
|
|
@@ -1207,16 +1416,36 @@ export class Context {
|
|
|
1207
1416
|
const chatId = this.#mustGetChatId();
|
|
1208
1417
|
return await this.client.stopPoll(chatId, messageId, params);
|
|
1209
1418
|
}
|
|
1419
|
+
/** Context-aware alias for {@link Client.summarizeText}. */
|
|
1420
|
+
async summarizeText(messageId, params) {
|
|
1421
|
+
const chatId = this.#mustGetChatId();
|
|
1422
|
+
return await this.client.summarizeText(chatId, messageId, params);
|
|
1423
|
+
}
|
|
1210
1424
|
/** Context-aware alias for {@link Client.transcribeVoice}. */
|
|
1211
1425
|
async transcribeVoice(messageId) {
|
|
1212
1426
|
const chatId = this.#mustGetChatId();
|
|
1213
1427
|
return await this.client.transcribeVoice(chatId, messageId);
|
|
1214
1428
|
}
|
|
1429
|
+
/** Context-aware alias for {@link Client.transferGift}. */
|
|
1430
|
+
async transferGift(gift) {
|
|
1431
|
+
const chatId = this.#mustGetChatId();
|
|
1432
|
+
return await this.client.transferGift(chatId, gift);
|
|
1433
|
+
}
|
|
1215
1434
|
/** Context-aware alias for {@link Client.transferChatOwnership}. */
|
|
1216
1435
|
async transferOwnership(userId, password) {
|
|
1217
1436
|
const chatId = this.#mustGetChatId();
|
|
1218
1437
|
return await this.client.transferChatOwnership(chatId, userId, password);
|
|
1219
1438
|
}
|
|
1439
|
+
/** Context-aware alias for {@link Client.translateMessage}. */
|
|
1440
|
+
async translateMessage(toLanguage, messageId, params) {
|
|
1441
|
+
const chatId = this.#mustGetChatId();
|
|
1442
|
+
return await this.client.translateMessage(toLanguage, chatId, messageId, params);
|
|
1443
|
+
}
|
|
1444
|
+
/** Context-aware alias for {@link Client.translateMessages}. */
|
|
1445
|
+
async translateMessages(toLanguage, messageIds, params) {
|
|
1446
|
+
const chatId = this.#mustGetChatId();
|
|
1447
|
+
return await this.client.translateMessages(toLanguage, chatId, messageIds, params);
|
|
1448
|
+
}
|
|
1220
1449
|
/** Context-aware alias for {@link Client.unarchiveChat}. */
|
|
1221
1450
|
async unarchive() {
|
|
1222
1451
|
const chatId = this.#mustGetChatId();
|
|
@@ -1266,4 +1495,19 @@ export class Context {
|
|
|
1266
1495
|
const chatId = this.#mustGetChatId();
|
|
1267
1496
|
return await this.client.updateChecklist(chatId, messageId, params);
|
|
1268
1497
|
}
|
|
1498
|
+
/** Context-aware alias for {@link Client.viewMessage}. */
|
|
1499
|
+
async viewMessage(messageId) {
|
|
1500
|
+
const chatId = this.#mustGetChatId();
|
|
1501
|
+
return await this.client.viewMessage(chatId, messageId);
|
|
1502
|
+
}
|
|
1503
|
+
/** Context-aware alias for {@link Client.viewMessages}. */
|
|
1504
|
+
async viewMessages(messageIds) {
|
|
1505
|
+
const chatId = this.#mustGetChatId();
|
|
1506
|
+
return await this.client.viewMessages(chatId, messageIds);
|
|
1507
|
+
}
|
|
1508
|
+
/** Context-aware alias for {@link Client.vote}. */
|
|
1509
|
+
async vote(messageId, optionIndexes) {
|
|
1510
|
+
const chatId = this.#mustGetChatId();
|
|
1511
|
+
return await this.client.vote(chatId, messageId, optionIndexes);
|
|
1512
|
+
}
|
|
1269
1513
|
}
|
|
@@ -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"}
|