@mtkruto/node 0.144.0 → 0.146.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 +4 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +4 -0
- package/esm/client/0_params.d.ts +8 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +95 -3
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.js +1 -2
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +22 -23
- package/esm/client/3_account_manager.d.ts +5 -1
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +23 -1
- package/esm/client/3_message_manager.d.ts +10 -2
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +64 -1
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +1 -2
- package/esm/client/6_client.d.ts +95 -3
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +119 -4
- package/esm/client/6_client_dispatcher.d.ts +95 -3
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +117 -1
- package/esm/deps/jsr.io/@std/assert/1.0.19/equals.js +4 -4
- package/esm/deps/jsr.io/@std/internal/1.0.14/_os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.14/_os.js +14 -0
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/build_message.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff.js +4 -3
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff_str.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff_str.js +8 -9
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/format.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/styles.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/join.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +1 -1
- package/esm/types/0_authorization_session.d.ts +43 -0
- package/esm/types/0_authorization_session.d.ts.map +1 -0
- package/esm/types/0_authorization_session.js +41 -0
- package/esm/types/0_message_counters.d.ts +29 -0
- package/esm/types/0_message_counters.d.ts.map +1 -0
- package/esm/types/0_message_counters.js +20 -0
- package/esm/types/1_chat_action.d.ts +1 -1
- package/esm/types/1_chat_action.d.ts.map +1 -1
- package/esm/types/1_chat_action.js +3 -3
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +2 -3
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.js +1 -2
- package/esm/types/3_bot_access_settings.d.ts +2 -2
- package/esm/types/3_bot_access_settings.d.ts.map +1 -1
- package/esm/types/3_message_draft.d.ts.map +1 -1
- package/esm/types/3_message_draft.js +1 -2
- package/esm/types/3_text_to_translate.d.ts +25 -0
- package/esm/types/3_text_to_translate.d.ts.map +1 -0
- package/esm/types/3_text_to_translate.js +20 -0
- package/esm/types/3_translated_text.d.ts +25 -0
- package/esm/types/3_translated_text.d.ts.map +1 -0
- package/esm/types/3_translated_text.js +20 -0
- package/esm/types/7_inline_query_result.d.ts.map +1 -1
- package/esm/types/7_inline_query_result.js +19 -1
- package/esm/types/7_saved_chat.d.ts +2 -3
- package/esm/types/7_saved_chat.d.ts.map +1 -1
- package/esm/types/7_saved_chat.js +3 -3
- package/package.json +1 -1
- package/script/3_types.d.ts +4 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +4 -0
- package/script/client/0_params.d.ts +8 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +95 -3
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.js +1 -2
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +22 -23
- package/script/client/3_account_manager.d.ts +5 -1
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +22 -0
- package/script/client/3_message_manager.d.ts +10 -2
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +63 -0
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +1 -2
- package/script/client/6_client.d.ts +95 -3
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +119 -4
- package/script/client/6_client_dispatcher.d.ts +95 -3
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +117 -1
- package/script/deps/jsr.io/@std/assert/1.0.19/equals.js +4 -4
- package/script/deps/jsr.io/@std/internal/1.0.14/_os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/_os.js +7 -5
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/build_message.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff.js +4 -3
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff_str.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff_str.js +8 -9
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/format.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/styles.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/basename.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/extname.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/join.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.js +1 -1
- package/script/types/0_authorization_session.d.ts +43 -0
- package/script/types/0_authorization_session.d.ts.map +1 -0
- package/script/types/0_authorization_session.js +44 -0
- package/script/types/0_message_counters.d.ts +29 -0
- package/script/types/0_message_counters.d.ts.map +1 -0
- package/script/types/0_message_counters.js +21 -0
- package/script/types/1_chat_action.d.ts +1 -1
- package/script/types/1_chat_action.d.ts.map +1 -1
- package/script/types/1_chat_action.js +3 -3
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +2 -3
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.js +1 -2
- package/script/types/3_bot_access_settings.d.ts +2 -2
- package/script/types/3_bot_access_settings.d.ts.map +1 -1
- package/script/types/3_message_draft.d.ts.map +1 -1
- package/script/types/3_message_draft.js +1 -2
- package/script/types/3_text_to_translate.d.ts +25 -0
- package/script/types/3_text_to_translate.d.ts.map +1 -0
- package/script/types/3_text_to_translate.js +21 -0
- package/script/types/3_translated_text.d.ts +25 -0
- package/script/types/3_translated_text.d.ts.map +1 -0
- package/script/types/3_translated_text.js +21 -0
- package/script/types/7_inline_query_result.d.ts.map +1 -1
- package/script/types/7_inline_query_result.js +19 -1
- package/script/types/7_saved_chat.d.ts +2 -3
- package/script/types/7_saved_chat.d.ts.map +1 -1
- package/script/types/7_saved_chat.js +3 -3
- package/esm/deps/jsr.io/@std/internal/1.0.13/_os.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.13/_os.js +0 -12
- package/script/deps/jsr.io/@std/internal/1.0.13/_os.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/_os.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/build_message.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff_str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/format.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/format.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/styles.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/styles.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/types.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/_os.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/build_message.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/diff_str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/format.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/format.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/os.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/styles.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/styles.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.13 → 1.0.14}/types.js +0 -0
|
@@ -24,7 +24,6 @@ import { getLogger, Mutex, Queue, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
|
24
24
|
import { Api } from "../2_tl.js";
|
|
25
25
|
import { PersistentTimestampInvalid } from "../3_errors.js";
|
|
26
26
|
import { CHANNEL_DIFFERENCE_LIMIT_BOT, CHANNEL_DIFFERENCE_LIMIT_USER } from "../4_constants.js";
|
|
27
|
-
import { peerToChatId } from "../tl/2_telegram.js";
|
|
28
27
|
export class UpdateManager {
|
|
29
28
|
static QTS_COUNT = 1;
|
|
30
29
|
static MAIN_BOX_ID = 0n;
|
|
@@ -797,10 +796,10 @@ export class UpdateManager {
|
|
|
797
796
|
const chatIds = new Set();
|
|
798
797
|
if (Api.is("messageFwdHeader", object)) {
|
|
799
798
|
if (object.from_id) {
|
|
800
|
-
chatIds.add(peerToChatId(object.from_id));
|
|
799
|
+
chatIds.add(Api.peerToChatId(object.from_id));
|
|
801
800
|
}
|
|
802
801
|
if (object.saved_from_peer) {
|
|
803
|
-
chatIds.add(peerToChatId(object.saved_from_peer));
|
|
802
|
+
chatIds.add(Api.peerToChatId(object.saved_from_peer));
|
|
804
803
|
}
|
|
805
804
|
return chatIds;
|
|
806
805
|
}
|
|
@@ -808,20 +807,20 @@ export class UpdateManager {
|
|
|
808
807
|
switch (object._) {
|
|
809
808
|
case "messageMediaContact":
|
|
810
809
|
if (object.user_id) {
|
|
811
|
-
chatIds.add(peerToChatId({ _: "peerUser", user_id: object.user_id }));
|
|
810
|
+
chatIds.add(Api.peerToChatId({ _: "peerUser", user_id: object.user_id }));
|
|
812
811
|
}
|
|
813
812
|
break;
|
|
814
813
|
case "messageMediaStory":
|
|
815
|
-
chatIds.add(peerToChatId(object.peer));
|
|
814
|
+
chatIds.add(Api.peerToChatId(object.peer));
|
|
816
815
|
break;
|
|
817
816
|
case "messageMediaGiveaway":
|
|
818
|
-
for (const chatId of object.channels.map((v) => peerToChatId({ _: "peerChannel", channel_id: v }))) {
|
|
817
|
+
for (const chatId of object.channels.map((v) => Api.peerToChatId({ _: "peerChannel", channel_id: v }))) {
|
|
819
818
|
chatIds.add(chatId);
|
|
820
819
|
}
|
|
821
820
|
break;
|
|
822
821
|
case "messageMediaGiveawayResults":
|
|
823
|
-
chatIds.add(peerToChatId({ _: "peerChannel", channel_id: object.channel_id }));
|
|
824
|
-
for (const chatId of object.winners.map((user_id) => peerToChatId({ _: "peerUser", user_id }))) {
|
|
822
|
+
chatIds.add(Api.peerToChatId({ _: "peerChannel", channel_id: object.channel_id }));
|
|
823
|
+
for (const chatId of object.winners.map((user_id) => Api.peerToChatId({ _: "peerUser", user_id }))) {
|
|
825
824
|
chatIds.add(chatId);
|
|
826
825
|
}
|
|
827
826
|
}
|
|
@@ -834,9 +833,9 @@ export class UpdateManager {
|
|
|
834
833
|
if (Api.is("messageEmpty", object.message)) {
|
|
835
834
|
return chatIds;
|
|
836
835
|
}
|
|
837
|
-
chatIds.add(peerToChatId(object.message.peer_id));
|
|
836
|
+
chatIds.add(Api.peerToChatId(object.message.peer_id));
|
|
838
837
|
if (object.message.from_id) {
|
|
839
|
-
chatIds.add(peerToChatId(object.message.from_id));
|
|
838
|
+
chatIds.add(Api.peerToChatId(object.message.from_id));
|
|
840
839
|
}
|
|
841
840
|
if (Api.is("messageService", object.message)) {
|
|
842
841
|
switch (object.message.action._) {
|
|
@@ -844,43 +843,43 @@ export class UpdateManager {
|
|
|
844
843
|
case "messageActionChatAddUser":
|
|
845
844
|
case "messageActionInviteToGroupCall":
|
|
846
845
|
for (const user_id of object.message.action.users) {
|
|
847
|
-
chatIds.add(peerToChatId({ _: "peerUser", user_id }));
|
|
846
|
+
chatIds.add(Api.peerToChatId({ _: "peerUser", user_id }));
|
|
848
847
|
}
|
|
849
848
|
break;
|
|
850
849
|
case "messageActionChatDeleteUser":
|
|
851
|
-
chatIds.add(peerToChatId({ _: "peerUser", user_id: object.message.action.user_id }));
|
|
850
|
+
chatIds.add(Api.peerToChatId({ _: "peerUser", user_id: object.message.action.user_id }));
|
|
852
851
|
break;
|
|
853
852
|
case "messageActionChatMigrateTo":
|
|
854
|
-
chatIds.add(peerToChatId({ _: "peerChannel", channel_id: object.message.action.channel_id }));
|
|
853
|
+
chatIds.add(Api.peerToChatId({ _: "peerChannel", channel_id: object.message.action.channel_id }));
|
|
855
854
|
break;
|
|
856
855
|
case "messageActionChannelMigrateFrom":
|
|
857
|
-
chatIds.add(peerToChatId({ _: "peerChat", chat_id: object.message.action.chat_id }));
|
|
856
|
+
chatIds.add(Api.peerToChatId({ _: "peerChat", chat_id: object.message.action.chat_id }));
|
|
858
857
|
break;
|
|
859
858
|
case "messageActionConferenceCall":
|
|
860
859
|
if (object.message.action.other_participants) {
|
|
861
860
|
for (const participant of object.message.action.other_participants) {
|
|
862
|
-
chatIds.add(peerToChatId(participant));
|
|
861
|
+
chatIds.add(Api.peerToChatId(participant));
|
|
863
862
|
}
|
|
864
863
|
}
|
|
865
864
|
break;
|
|
866
865
|
case "messageActionPaymentRefunded":
|
|
867
|
-
chatIds.add(peerToChatId(object.message.action.peer));
|
|
866
|
+
chatIds.add(Api.peerToChatId(object.message.action.peer));
|
|
868
867
|
break;
|
|
869
868
|
case "messageActionGiftCode":
|
|
870
869
|
if (object.message.action.boost_peer) {
|
|
871
|
-
chatIds.add(peerToChatId(object.message.action.boost_peer));
|
|
870
|
+
chatIds.add(Api.peerToChatId(object.message.action.boost_peer));
|
|
872
871
|
}
|
|
873
872
|
break;
|
|
874
873
|
case "messageActionRequestedPeer":
|
|
875
874
|
if (!this.#c.storage.isBot) {
|
|
876
875
|
for (const peer of object.message.action.peers) {
|
|
877
|
-
chatIds.add(peerToChatId(peer));
|
|
876
|
+
chatIds.add(Api.peerToChatId(peer));
|
|
878
877
|
}
|
|
879
878
|
}
|
|
880
879
|
break;
|
|
881
880
|
case "messageActionSetMessagesTTL":
|
|
882
881
|
if (object.message.action.auto_setting_from) {
|
|
883
|
-
chatIds.add(peerToChatId({ _: "peerUser", user_id: object.message.action.auto_setting_from }));
|
|
882
|
+
chatIds.add(Api.peerToChatId({ _: "peerUser", user_id: object.message.action.auto_setting_from }));
|
|
884
883
|
}
|
|
885
884
|
}
|
|
886
885
|
}
|
|
@@ -889,7 +888,7 @@ export class UpdateManager {
|
|
|
889
888
|
switch (object.message.reply_to._) {
|
|
890
889
|
case "messageReplyHeader":
|
|
891
890
|
if (object.message.reply_to.reply_to_peer_id) {
|
|
892
|
-
chatIds.add(peerToChatId(object.message.reply_to.reply_to_peer_id));
|
|
891
|
+
chatIds.add(Api.peerToChatId(object.message.reply_to.reply_to_peer_id));
|
|
893
892
|
}
|
|
894
893
|
if (object.message.reply_to.reply_from) {
|
|
895
894
|
for (const chatId of this.#collectChatIds(object.message.reply_to.reply_from)) {
|
|
@@ -908,7 +907,7 @@ export class UpdateManager {
|
|
|
908
907
|
}
|
|
909
908
|
break;
|
|
910
909
|
case "messageReplyStoryHeader":
|
|
911
|
-
chatIds.add(peerToChatId(object.message.reply_to.peer));
|
|
910
|
+
chatIds.add(Api.peerToChatId(object.message.reply_to.peer));
|
|
912
911
|
}
|
|
913
912
|
}
|
|
914
913
|
if (object.message.fwd_from) {
|
|
@@ -917,7 +916,7 @@ export class UpdateManager {
|
|
|
917
916
|
}
|
|
918
917
|
}
|
|
919
918
|
if (object.message.via_bot_id) {
|
|
920
|
-
chatIds.add(peerToChatId({ _: "peerUser", user_id: object.message.via_bot_id }));
|
|
919
|
+
chatIds.add(Api.peerToChatId({ _: "peerUser", user_id: object.message.via_bot_id }));
|
|
921
920
|
}
|
|
922
921
|
if (object.message.entities) {
|
|
923
922
|
for (const chatId of this.#collectChatIdsFromEntities(object.message.entities)) {
|
|
@@ -935,7 +934,7 @@ export class UpdateManager {
|
|
|
935
934
|
#collectChatIdsFromEntities(entities) {
|
|
936
935
|
const chatIds = new Array();
|
|
937
936
|
for (const user_id of entities.filter((v) => Api.is("messageEntityMentionName", v)).map((v) => v.user_id)) {
|
|
938
|
-
chatIds.push(peerToChatId({ _: "peerUser", user_id }));
|
|
937
|
+
chatIds.push(Api.peerToChatId({ _: "peerUser", user_id }));
|
|
939
938
|
}
|
|
940
939
|
return chatIds;
|
|
941
940
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
21
|
import { type Birthday, type BotTokenCheckResult, type CodeCheckResult, type FileSource, type ID, type InputEmojiStatus, type PasswordCheckResult, type Update } from "../3_types.js";
|
|
22
|
-
import type { AddBotToAttachmentsMenuParams, CheckUsernameParams, GetProfilePhotosParams, RemoveProfilePhotoParams, ResolveUsernameParams, SetBirthdayParams, SetEmojiStatusParams, SetLocationParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetWorkingHoursParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
|
|
22
|
+
import type { AddBotToAttachmentsMenuParams, CheckUsernameParams, DeleteAccountParams, GetProfilePhotosParams, RemoveProfilePhotoParams, ResolveUsernameParams, SetBirthdayParams, SetEmojiStatusParams, SetLocationParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetWorkingHoursParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
|
|
23
23
|
import type { UpdateProcessor } from "./0_update_processor.js";
|
|
24
24
|
import type { C as C_ } from "./1_types.js";
|
|
25
25
|
import type { FileManager } from "./2_file_manager.js";
|
|
@@ -80,6 +80,10 @@ export declare class AccountManager implements UpdateProcessor<AccountManagerUpd
|
|
|
80
80
|
updateProfileVideo(photo: FileSource, params?: UpdateProfileVideoParams): Promise<void>;
|
|
81
81
|
removeProfilePhoto(params?: RemoveProfilePhotoParams): Promise<void>;
|
|
82
82
|
getProfilePhotos(userId: ID, params?: GetProfilePhotosParams): Promise<import("../3_types.js").ProfilePhotoList>;
|
|
83
|
+
deleteAccount(reason: string, params?: DeleteAccountParams): Promise<void>;
|
|
84
|
+
getAuthorizationSessions(): Promise<import("../3_types.js").AuthorizationSession[]>;
|
|
85
|
+
removeAuthorizationSession(id: string): Promise<void>;
|
|
86
|
+
removeAuthorizationSessions(): Promise<void>;
|
|
83
87
|
}
|
|
84
88
|
export {};
|
|
85
89
|
//# sourceMappingURL=3_account_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_account_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_account_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,KAAK,QAAQ,EAAsB,KAAK,mBAAmB,EAAE,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"3_account_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_account_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE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} from "../0_deps.js";
|
|
|
21
21
|
import { InputError } from "../0_errors.js";
|
|
22
22
|
import { Api } from "../2_tl.js";
|
|
23
23
|
import { PasswordHashInvalid, PhoneCodeInvalid, SessionPasswordNeeded } from "../3_errors.js";
|
|
24
|
-
import { birthdayToTlObject, constructAppSupport, constructCountry, constructEmojiStatus, constructInactiveChat, constructProfilePhotoList, constructTimezone, constructUser, constructUser2, workingHoursToTlObject } from "../3_types.js";
|
|
24
|
+
import { birthdayToTlObject, constructAppSupport, constructAuthorizationSession, constructCountry, constructEmojiStatus, constructInactiveChat, constructProfilePhotoList, constructTimezone, constructUser, constructUser2, workingHoursToTlObject } from "../3_types.js";
|
|
25
25
|
import { checkPassword } from "./0_password.js";
|
|
26
26
|
import { canBeInputChannel, canBeInputUser, checkPhotoName, getLimit, toInputChannel, toInputUser } from "./0_utilities.js";
|
|
27
27
|
const accountManagerUpdates = [
|
|
@@ -480,4 +480,26 @@ export class AccountManager {
|
|
|
480
480
|
const result = await this.#c.invoke({ _: "photos.getUserPhotos", user_id, offset, limit, max_id: 0n });
|
|
481
481
|
return constructProfilePhotoList(result);
|
|
482
482
|
}
|
|
483
|
+
async deleteAccount(reason, params) {
|
|
484
|
+
this.#c.storage.assertUser("deleteAccount");
|
|
485
|
+
let password;
|
|
486
|
+
if (params?.password) {
|
|
487
|
+
const ap = await this.#getAccountPassword();
|
|
488
|
+
password = await checkPassword(params.password, ap);
|
|
489
|
+
}
|
|
490
|
+
await this.#c.invoke({ _: "account.deleteAccount", reason, password });
|
|
491
|
+
}
|
|
492
|
+
async getAuthorizationSessions() {
|
|
493
|
+
this.#c.storage.assertUser("getAuthorizationSessions");
|
|
494
|
+
const result = await this.#c.invoke({ _: "account.getAuthorizations" });
|
|
495
|
+
return result.authorizations.map(constructAuthorizationSession);
|
|
496
|
+
}
|
|
497
|
+
async removeAuthorizationSession(id) {
|
|
498
|
+
this.#c.storage.assertUser("removeAuthorizationSession");
|
|
499
|
+
await this.#c.invoke({ _: "account.resetAuthorization", hash: BigInt(id) });
|
|
500
|
+
}
|
|
501
|
+
async removeAuthorizationSessions() {
|
|
502
|
+
this.#c.storage.assertUser("removeAuthorizationSessions");
|
|
503
|
+
await this.#c.invoke({ _: "auth.resetAuthorizations" });
|
|
504
|
+
}
|
|
483
505
|
}
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
import { Api } from "../2_tl.js";
|
|
21
|
-
import { type InlineQueryResult, type InputChecklistItem, type InputMedia, type InputPollOption, type MessageGetter, type MessageList, type MessageLivePhoto, type MessagePhoto, type PriceTag, type VoiceTranscription } from "../3_types.js";
|
|
21
|
+
import { type InlineQueryResult, type InputChecklistItem, type InputMedia, type InputPollOption, type MessageCounters, type MessageGetter, type MessageList, type MessageLivePhoto, type MessagePhoto, type PriceTag, type TextToTranslate, type TranslatedText, type VoiceTranscription } from "../3_types.js";
|
|
22
22
|
import { type ChatActionType, type FileSource, FileType, type ID, type Message, type MessageEntity, type ParseMode, type Reaction, type Update, type UsernameResolver } from "../3_types.js";
|
|
23
|
-
import type { AddReactionParams, DeleteMessagesParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, ForwardMessagesParams, GetBlockedUsersParams, GetHistoryParams, GetMessageReactionsParams, GetSavedChatsParams, GetSavedMessagesParams, OpenMiniAppParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendChecklistParams as SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetReactionsParams, StartBotParams, StopPollParams, SummarizeTextParams, UnpinMessageParams, UnpinMessagesParams } from "./0_params.js";
|
|
23
|
+
import type { AddReactionParams, DeleteMessagesParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, ForwardMessagesParams, GetBlockedUsersParams, GetHistoryParams, GetMessageReactionsParams, GetSavedChatsParams, GetSavedMessagesParams, OpenMiniAppParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendChecklistParams as SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetReactionsParams, StartBotParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams } from "./0_params.js";
|
|
24
24
|
import type { UpdateProcessor } from "./0_update_processor.js";
|
|
25
25
|
import type { C as C_ } from "./1_types.js";
|
|
26
26
|
import type { FileManager } from "./2_file_manager.js";
|
|
@@ -120,6 +120,14 @@ export declare class MessageManager implements UpdateProcessor<MessageManagerUpd
|
|
|
120
120
|
clearDrafts(): Promise<void>;
|
|
121
121
|
summarizeText(chatId: ID, messageId: number, params?: SummarizeTextParams): Promise<import("../3_types.js").SummarizedText>;
|
|
122
122
|
answerGuestQuery(id: string, result_: InlineQueryResult): Promise<string>;
|
|
123
|
+
viewMessages(chatId: ID, messageIds: number[]): Promise<void>;
|
|
124
|
+
viewMessage(chatId: ID, messageId: number): Promise<void>;
|
|
125
|
+
getMessagesCounters(chatId: ID, messageIds: number[]): Promise<MessageCounters[]>;
|
|
126
|
+
getMessageCounters(chatId: ID, messageId: number): Promise<MessageCounters>;
|
|
127
|
+
translateTexts(toLanguage: string, texts: TextToTranslate[], params?: TranslateTextParams): Promise<TranslatedText[]>;
|
|
128
|
+
translateText(toLanguage: string, text: TextToTranslate, params?: TranslateTextParams): Promise<TranslatedText>;
|
|
129
|
+
translateMessages(toLanguage: string, chatId: ID, messageIds: number[], params?: TranslateTextParams): Promise<TranslatedText[]>;
|
|
130
|
+
translateMessage(toLanguage: string, chatId: ID, messageId: number, params?: TranslateTextParams): Promise<TranslatedText>;
|
|
123
131
|
}
|
|
124
132
|
export {};
|
|
125
133
|
//# sourceMappingURL=3_message_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_message_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,
|
|
1
|
+
{"version":3,"file":"3_message_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_message_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAA+P,KAAK,iBAAiB,EAA+B,KAAK,kBAAkB,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAiC,KAAK,QAAQ,EAAoD,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3pB,OAAO,EAAqB,KAAK,cAAc,EAAqE,KAAK,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,EAAE,KAAK,aAAa,EAA2B,KAAK,SAAS,EAAE,KAAK,QAAQ,EAA4D,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtW,OAAO,KAAK,EAA8E,iBAAiB,EAAE,oBAAoB,EAAE,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AAM,CAAC,EAAE,mBAAmB;IAiBrF,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAKhI,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB;CAIvG"}
|
|
@@ -22,7 +22,7 @@ import { InputError } from "../0_errors.js";
|
|
|
22
22
|
import { base64EncodeUrlSafe, encodeText, fromUnixTimestamp, getLogger, getRandomId } from "../1_utilities.js";
|
|
23
23
|
import { Api } from "../2_tl.js";
|
|
24
24
|
import { getDc } from "../3_transport.js";
|
|
25
|
-
import { constructBlockedUserList, constructChatAction, constructMessageDraft, constructMessageReactionList, constructMiniAppInfo, constructSavedChats, constructSummarizedText, constructVoiceTranscription, deserializeFileId, inlineQueryResultToTlObject, messageSearchFilterToTlObject, selfDestructOptionToInt } from "../3_types.js";
|
|
25
|
+
import { constructBlockedUserList, constructChatAction, constructMessageDraft, constructMessageEntity, constructMessageReactionList, constructMiniAppInfo, constructSavedChats, constructSummarizedText, constructVoiceTranscription, deserializeFileId, inlineQueryResultToTlObject, messageSearchFilterToTlObject, selfDestructOptionToInt } from "../3_types.js";
|
|
26
26
|
import { assertMessageType, constructMessage as constructMessage_, deserializeInlineMessageId, FileType, messageEntityToTlObject, reactionEqual, reactionToTlObject, replyMarkupToTlObject } from "../3_types.js";
|
|
27
27
|
import { parseHtml } from "./0_html.js";
|
|
28
28
|
import { parseMarkdown } from "./0_markdown.js";
|
|
@@ -1831,4 +1831,67 @@ export class MessageManager {
|
|
|
1831
1831
|
const result__ = await this.#c.invoke({ _: "messages.setBotGuestChatResult", query_id: BigInt(id), result });
|
|
1832
1832
|
return base64EncodeUrlSafe(Api.serializeObject(result__));
|
|
1833
1833
|
}
|
|
1834
|
+
async #viewMessages(chatId, messageIds) {
|
|
1835
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
1836
|
+
const id = messageIds;
|
|
1837
|
+
await this.#c.invoke({ _: "messages.getMessagesViews", peer, id, increment: true });
|
|
1838
|
+
}
|
|
1839
|
+
async viewMessages(chatId, messageIds) {
|
|
1840
|
+
this.#c.storage.assertUser("viewMessages");
|
|
1841
|
+
await this.#viewMessages(chatId, messageIds);
|
|
1842
|
+
}
|
|
1843
|
+
async viewMessage(chatId, messageId) {
|
|
1844
|
+
this.#c.storage.assertUser("viewMessage");
|
|
1845
|
+
await this.#viewMessages(chatId, [messageId]);
|
|
1846
|
+
}
|
|
1847
|
+
async #getMessagesCounters(chatId, messageIds) {
|
|
1848
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
1849
|
+
const id = messageIds;
|
|
1850
|
+
const result = await this.#c.invoke({ _: "messages.getMessagesViews", peer, id, increment: false });
|
|
1851
|
+
return result.views.map((v) => ({ views: v.views ?? 0, replies: v.replies?.replies ?? 0, forwards: v.forwards ?? 0 }));
|
|
1852
|
+
}
|
|
1853
|
+
async getMessagesCounters(chatId, messageIds) {
|
|
1854
|
+
this.#c.storage.assertUser("getMessagesCounters");
|
|
1855
|
+
return await this.#getMessagesCounters(chatId, messageIds);
|
|
1856
|
+
}
|
|
1857
|
+
async getMessageCounters(chatId, messageId) {
|
|
1858
|
+
this.#c.storage.assertUser("getMessageCounters");
|
|
1859
|
+
return (await this.#getMessagesCounters(chatId, [messageId]))[0];
|
|
1860
|
+
}
|
|
1861
|
+
async #translateTexts(toLanguage, texts, params) {
|
|
1862
|
+
const result = await this.#c.invoke({
|
|
1863
|
+
_: "messages.translateText",
|
|
1864
|
+
to_lang: toLanguage,
|
|
1865
|
+
text: texts.map((v) => ({ _: "textWithEntities", text: v.text, entities: v.entities.map((v) => messageEntityToTlObject(v, this.#c.getPeer)) })),
|
|
1866
|
+
tone: params?.tone,
|
|
1867
|
+
});
|
|
1868
|
+
return result.result.map((v) => ({ text: v.text, entities: v.entities.map(constructMessageEntity).filter((v) => v !== null) }));
|
|
1869
|
+
}
|
|
1870
|
+
async translateTexts(toLanguage, texts, params) {
|
|
1871
|
+
this.#c.storage.assertUser("translateTexts");
|
|
1872
|
+
return await this.#translateTexts(toLanguage, texts, params);
|
|
1873
|
+
}
|
|
1874
|
+
async translateText(toLanguage, text, params) {
|
|
1875
|
+
this.#c.storage.assertUser("translateText");
|
|
1876
|
+
return (await this.#translateTexts(toLanguage, [text], params))[0];
|
|
1877
|
+
}
|
|
1878
|
+
async #translateMessages(toLanguage, chatId, messageIds, params) {
|
|
1879
|
+
const peer = await this.#c.getInputPeer(chatId);
|
|
1880
|
+
const result = await this.#c.invoke({
|
|
1881
|
+
_: "messages.translateText",
|
|
1882
|
+
to_lang: toLanguage,
|
|
1883
|
+
peer,
|
|
1884
|
+
id: messageIds,
|
|
1885
|
+
tone: params?.tone,
|
|
1886
|
+
});
|
|
1887
|
+
return result.result.map((v) => ({ text: v.text, entities: v.entities.map(constructMessageEntity).filter((v) => v !== null) }));
|
|
1888
|
+
}
|
|
1889
|
+
async translateMessages(toLanguage, chatId, messageIds, params) {
|
|
1890
|
+
this.#c.storage.assertUser("translateMessages");
|
|
1891
|
+
return await this.#translateMessages(toLanguage, chatId, messageIds, params);
|
|
1892
|
+
}
|
|
1893
|
+
async translateMessage(toLanguage, chatId, messageId, params) {
|
|
1894
|
+
this.#c.storage.assertUser("translateMessage");
|
|
1895
|
+
return (await this.#translateMessages(toLanguage, chatId, [messageId], params))[0];
|
|
1896
|
+
}
|
|
1834
1897
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_video_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_video_chat_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAkD,KAAK,EAAE,EAAE,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AE,MAAM;IAKzB,cAAc,CAAC,EAAE,EAAE,MAAM;IA+BzB,YAAY,CAAC,EAAE,EAAE,MAAM;IAK7B,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,sBAAsB;IAI/D,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA8BpE,qBAAqB,CAAC,EAAE,EAAE,MAAM;IAWhC,yBAAyB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,+BAA+B;CAyBxI"}
|
|
@@ -23,7 +23,6 @@ import { getRandomId } from "../1_utilities.js";
|
|
|
23
23
|
import { Api } from "../2_tl.js";
|
|
24
24
|
import { getDc } from "../3_transport.js";
|
|
25
25
|
import { constructLiveStreamChannel, constructVideoChat } from "../3_types.js";
|
|
26
|
-
import { peerToChatId } from "../tl/2_telegram.js";
|
|
27
26
|
import { canBeInputUser } from "./0_utilities.js";
|
|
28
27
|
const videoChatManagerUpdates = [
|
|
29
28
|
"updateGroupCall",
|
|
@@ -118,7 +117,7 @@ export class VideoChatManager {
|
|
|
118
117
|
if (!update.peer) {
|
|
119
118
|
return null; // TODO: handle updates with unspecified chat_id
|
|
120
119
|
}
|
|
121
|
-
const chatId = peerToChatId(update.peer);
|
|
120
|
+
const chatId = Api.peerToChatId(update.peer);
|
|
122
121
|
const fullChat = await this.#c.messageStorage.getFullChat(chatId).then((v) => v === null ? this.#c.messageStorage.getFullChat(chatId) : v);
|
|
123
122
|
let updateFullChat = false;
|
|
124
123
|
if (Api.is("groupCallDiscarded", update.call)) {
|
package/esm/client/6_client.d.ts
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
import { type Storage } from "../2_storage.js";
|
|
21
21
|
import { Api, Mtproto } from "../2_tl.js";
|
|
22
22
|
import { type DC } from "../3_transport.js";
|
|
23
|
-
import { type AlbumStoryList, type AppSupport, type AvailableReactions, type Birthday, type BlockedUserList, type BotAccessSettings, type BotCommand, type BotTokenCheckResult, type BusinessConnection, type CallbackQueryAnswer, type CallbackQueryQuestion, type Chat, type ChatActionType, type ChatListItem, type ChatMember, type ChatP, type ChatPChannel, type ChatPGroup, type ChatPPrivate, type ChatPSupergroup, type ChatSettings, type ClaimedGifts, type CodeCheckResult, type Country, type FailedInvitation, type FileSource, type Gift, type GiftCollection, type ID, type InactiveChat, type InlineQueryAnswer, type InlineQueryResult, type InputChecklistItem, type InputEmojiStatus, type InputGift, type InputMedia, type InputPollOption, type InputSticker, type InputStoryContent, type InviteLink, type JoinRequest, type LeftChannelList, type LinkPreview, type LiveStreamChannel, type Message, type MessageAnimation, type MessageAudio, type MessageChecklist, type MessageContact, type MessageDice, type MessageDocument, type MessageInvoice, type MessageList, type MessageLivePhoto, type MessageLocation, type MessagePhoto, type MessagePoll, type MessageReactionList, type MessageSticker, type MessageText, type MessageVenue, type MessageVideo, type MessageVideoNote, type MessageVoice, type MiniAppInfo, type NetworkStatistics, type ParseMode, type PasswordCheckResult, type Poll, type PremiumSubscriptionDuration, type PriceTag, type ProfilePhotoList, type Reaction, type SavedChats, type SlowModeDuration, type StarAmount, type StarTransactionList, type Sticker, type StickerSet, type Story, type StoryAlbum, type SummarizedText, type Timezone, type Topic, type Translation, type User, type VideoChat, type VideoChatActive, type VideoChatScheduled, type VoiceTranscription } from "../3_types.js";
|
|
23
|
+
import { type AlbumStoryList, type AppSupport, type AuthorizationSession, type AvailableReactions, type Birthday, type BlockedUserList, type BotAccessSettings, type BotCommand, type BotTokenCheckResult, type BusinessConnection, type CallbackQueryAnswer, type CallbackQueryQuestion, type Chat, type ChatActionType, type ChatListItem, type ChatMember, type ChatP, type ChatPChannel, type ChatPGroup, type ChatPPrivate, type ChatPSupergroup, type ChatSettings, type ClaimedGifts, type CodeCheckResult, type Country, type FailedInvitation, type FileSource, type Gift, type GiftCollection, type ID, type InactiveChat, type InlineQueryAnswer, type InlineQueryResult, type InputChecklistItem, type InputEmojiStatus, type InputGift, type InputMedia, type InputPollOption, type InputSticker, type InputStoryContent, type InviteLink, type JoinRequest, type LeftChannelList, type LinkPreview, type LiveStreamChannel, type Message, type MessageAnimation, type MessageAudio, type MessageChecklist, type MessageContact, type MessageCounters, type MessageDice, type MessageDocument, type MessageInvoice, type MessageList, type MessageLivePhoto, type MessageLocation, type MessagePhoto, type MessagePoll, type MessageReactionList, type MessageSticker, type MessageText, type MessageVenue, type MessageVideo, type MessageVideoNote, type MessageVoice, type MiniAppInfo, type NetworkStatistics, type ParseMode, type PasswordCheckResult, type Poll, type PremiumSubscriptionDuration, type PriceTag, type ProfilePhotoList, type Reaction, type SavedChats, type SlowModeDuration, type StarAmount, type StarTransactionList, type Sticker, type StickerSet, type Story, type StoryAlbum, type SummarizedText, type TextToTranslate, type Timezone, type Topic, type TranslatedText, type Translation, type User, type VideoChat, type VideoChatActive, type VideoChatScheduled, type VoiceTranscription } from "../3_types.js";
|
|
24
24
|
import { Migrate } from "../4_errors.js";
|
|
25
|
-
import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
|
|
25
|
+
import type { AddBotToAttachmentsMenuParams, AddChatMemberParams, AddContactParams, AddReactionParams, AddStickerToStickerSetParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CheckUsernameParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStickerSetParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteAccountParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, EditTopicParams, EnableSignaturesParams, EndTakeoutSessionParams, ForwardMessagesParams, GetBlockedUsersParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLeftChannelsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetProfilePhotosParams, GetSavedChatsParams, GetSavedMessagesParams, GetStarTransactionsParams, GetTranslationsParams, GiftPremiumSubscriptionParams, InvokeParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, RemoveProfilePhotoParams, ReplaceStickerInStickerSetParams, ResolveUsernameParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChecklistParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLivePhotoParams, SendLocationParams, SendMediaGroupParams, SendMessageDraftParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatMemberTagParams, SetChatPhotoParams, SetContactNoteParams, SetEmojiStatusParams, SetLocationParams, SetManagedBotAccessSettingsParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetWorkingHoursParams, SignInParams, StartBotParams, StartTakeoutSessionParams, StartVideoChatParams, StopPollParams, SummarizeTextParams, TranslateTextParams, UnpinMessageParams, UnpinMessagesParams, UpdateChecklistParams, UpdateProfileParams, UpdateProfilePhotoParams, UpdateProfileVideoParams } from "./0_params.js";
|
|
26
26
|
import { StorageOperations } from "./0_storage_operations.js";
|
|
27
27
|
import type { ClientGeneric } from "./1_client_generic.js";
|
|
28
28
|
import type { ClientPlainParams } from "./1_client_plain.js";
|
|
@@ -500,6 +500,32 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
500
500
|
* @param userId The identifier of a user.
|
|
501
501
|
*/
|
|
502
502
|
getProfilePhotos(userId: ID, params?: GetProfilePhotosParams): Promise<ProfilePhotoList>;
|
|
503
|
+
/**
|
|
504
|
+
* Delete the current account. User-only.
|
|
505
|
+
*
|
|
506
|
+
* @method ac
|
|
507
|
+
* @param reason The reason of the deletion.
|
|
508
|
+
*/
|
|
509
|
+
deleteAccount(reason: string, params?: DeleteAccountParams): Promise<void>;
|
|
510
|
+
/**
|
|
511
|
+
* Get the authorization sessions. User-only.
|
|
512
|
+
*
|
|
513
|
+
* @method ac
|
|
514
|
+
*/
|
|
515
|
+
getAuthorizationSessions(): Promise<AuthorizationSession[]>;
|
|
516
|
+
/**
|
|
517
|
+
* Remove an authorization session. User-only.
|
|
518
|
+
*
|
|
519
|
+
* @method ac
|
|
520
|
+
* @param id The identifier of the authorization session to remove.
|
|
521
|
+
*/
|
|
522
|
+
removeAuthorizationSession(id: string): Promise<void>;
|
|
523
|
+
/**
|
|
524
|
+
* Remove all authorization sessions except for the current one. User-only.
|
|
525
|
+
*
|
|
526
|
+
* @method ac
|
|
527
|
+
*/
|
|
528
|
+
removeAuthorizationSessions(): Promise<void>;
|
|
503
529
|
/**
|
|
504
530
|
* Send a text message.
|
|
505
531
|
*
|
|
@@ -533,7 +559,7 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
533
559
|
* @method ms
|
|
534
560
|
* @param chatId The identifier of a chat to send the photo to.
|
|
535
561
|
* @param photo The photo to send.
|
|
536
|
-
* @param
|
|
562
|
+
* @param video The video version of the photo.
|
|
537
563
|
* @returns The sent live photo.
|
|
538
564
|
*/
|
|
539
565
|
sendLivePhoto(chatId: ID, photo: FileSource, video: FileSource, params?: SendLivePhotoParams): Promise<MessageLivePhoto>;
|
|
@@ -1018,6 +1044,72 @@ export declare class Client<C extends Context = Context> extends Composer<C> imp
|
|
|
1018
1044
|
* @param messageId The identifier of a message.
|
|
1019
1045
|
*/
|
|
1020
1046
|
summarizeText(chatId: ID, messageId: number, params?: SummarizeTextParams): Promise<SummarizedText>;
|
|
1047
|
+
/**
|
|
1048
|
+
* View multiple messages. User-only.
|
|
1049
|
+
*
|
|
1050
|
+
* @method ms
|
|
1051
|
+
* @param chatId The identifier of the chat including the messages.
|
|
1052
|
+
* @param messageIds The identifiers of the messages.
|
|
1053
|
+
*/
|
|
1054
|
+
viewMessages(chatId: ID, messageIds: number[]): Promise<void>;
|
|
1055
|
+
/**
|
|
1056
|
+
* View a single message. User-only.
|
|
1057
|
+
*
|
|
1058
|
+
* @method ms
|
|
1059
|
+
* @param chatId The identifier of the chat including the message.
|
|
1060
|
+
* @param messageId The identifier of the message.
|
|
1061
|
+
*/
|
|
1062
|
+
viewMessage(chatId: ID, messageId: number): Promise<void>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Translate multiple texts. User-only.
|
|
1065
|
+
*
|
|
1066
|
+
* @method ms
|
|
1067
|
+
* @param toLanguage The code of the language to translate into.
|
|
1068
|
+
* @param texts The texts to translate.
|
|
1069
|
+
*/
|
|
1070
|
+
translateTexts(toLanguage: string, texts: TextToTranslate[], params?: TranslateTextParams): Promise<TranslatedText[]>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Translate a single text. User-only.
|
|
1073
|
+
*
|
|
1074
|
+
* @method ms
|
|
1075
|
+
* @param toLanguage The code of the language to translate into.
|
|
1076
|
+
* @param text The text to translate.
|
|
1077
|
+
*/
|
|
1078
|
+
translateText(toLanguage: string, text: TextToTranslate, params?: TranslateTextParams): Promise<TranslatedText>;
|
|
1079
|
+
/**
|
|
1080
|
+
* Translate multiple texts. User-only.
|
|
1081
|
+
*
|
|
1082
|
+
* @method ms
|
|
1083
|
+
* @param toLanguage The code of the language to translate into.
|
|
1084
|
+
* @param chatId The identifier of the chat including the messages.
|
|
1085
|
+
* @param messageIds The identifiers of the messages to translate.
|
|
1086
|
+
*/
|
|
1087
|
+
translateMessages(toLanguage: string, chatId: ID, messageIds: number[], params?: TranslateTextParams): Promise<TranslatedText[]>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Translate a single text. User-only.
|
|
1090
|
+
*
|
|
1091
|
+
* @method ms
|
|
1092
|
+
* @param toLanguage The code of the language to translate into.
|
|
1093
|
+
* @param chatId The identifier of the chat including the message.
|
|
1094
|
+
* @param messageId The identifier of the message to translate.
|
|
1095
|
+
*/
|
|
1096
|
+
translateMessage(toLanguage: string, chatId: ID, messageId: number, params?: TranslateTextParams): Promise<TranslatedText>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Get the counters of multiple messages. User-only.
|
|
1099
|
+
*
|
|
1100
|
+
* @method ms
|
|
1101
|
+
* @param chatId The identifier of the chat including the messages.
|
|
1102
|
+
* @param messageIds The identifiers of the messages.
|
|
1103
|
+
*/
|
|
1104
|
+
getMessagesCounters(chatId: ID, messageIds: number[]): Promise<MessageCounters[]>;
|
|
1105
|
+
/**
|
|
1106
|
+
* Get the counters of a single message. User-only.
|
|
1107
|
+
*
|
|
1108
|
+
* @method ms
|
|
1109
|
+
* @param chatId The identifier of the chat including the message.
|
|
1110
|
+
* @param messageId The identifier of the message.
|
|
1111
|
+
*/
|
|
1112
|
+
getMessageCounters(chatId: ID, messageId: number): Promise<MessageCounters>;
|
|
1021
1113
|
/**
|
|
1022
1114
|
* Cast a vote. User-only.
|
|
1023
1115
|
*
|