@mtkruto/node 0.0.989 → 0.0.990
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/client/3_client.js +12 -12
- package/esm/constants.d.ts +1 -1
- package/esm/constants.js +1 -1
- package/esm/tl/2_types.d.ts +2055 -1617
- package/esm/tl/2_types.js +3447 -3447
- package/esm/tl/3_functions.d.ts +154 -154
- package/esm/tl/3_functions.js +988 -988
- package/esm/types/0_poll_option.d.ts +8 -0
- package/esm/types/0_poll_option.js +6 -0
- package/esm/types/1_chat.js +3 -4
- package/esm/types/1_keyboard_button.js +4 -5
- package/esm/types/1_photo.js +0 -2
- package/esm/types/1_poll.d.ts +32 -0
- package/esm/types/1_poll.js +23 -0
- package/esm/types/1_sticker.js +1 -1
- package/esm/types/1_user.js +1 -2
- package/esm/types/2_game.js +2 -2
- package/esm/types/2_inline_keyboard_markup.js +1 -2
- package/esm/types/2_reply_keyboard_markup.js +1 -2
- package/esm/types/3_message.d.ts +2 -0
- package/esm/types/3_message.js +4 -0
- package/esm/utilities/0_queue.d.ts +2 -0
- package/esm/utilities/0_queue.js +14 -2
- package/esm/utilities/1_misc.js +1 -1
- package/package.json +1 -1
- package/script/client/3_client.js +12 -12
- package/script/constants.d.ts +1 -1
- package/script/constants.js +1 -1
- package/script/tl/2_types.d.ts +2055 -1617
- package/script/tl/2_types.js +3894 -3894
- package/script/tl/3_functions.d.ts +154 -154
- package/script/tl/3_functions.js +988 -988
- package/script/types/0_poll_option.d.ts +8 -0
- package/script/types/0_poll_option.js +10 -0
- package/script/types/1_chat.js +3 -4
- package/script/types/1_keyboard_button.js +4 -5
- package/script/types/1_photo.js +0 -2
- package/script/types/1_poll.d.ts +32 -0
- package/script/types/1_poll.js +27 -0
- package/script/types/1_sticker.js +1 -1
- package/script/types/1_user.js +1 -2
- package/script/types/2_game.js +2 -2
- package/script/types/2_inline_keyboard_markup.js +1 -2
- package/script/types/2_reply_keyboard_markup.js +1 -2
- package/script/types/3_message.d.ts +2 -0
- package/script/types/3_message.js +4 -0
- package/script/utilities/0_queue.d.ts +2 -0
- package/script/utilities/0_queue.js +14 -2
- package/script/utilities/1_misc.js +1 -1
package/esm/client/3_client.js
CHANGED
|
@@ -220,13 +220,13 @@ export class Client extends ClientAbstract {
|
|
|
220
220
|
enumerable: true,
|
|
221
221
|
configurable: true,
|
|
222
222
|
writable: true,
|
|
223
|
-
value: new Queue()
|
|
223
|
+
value: new Queue("handleUpdate")
|
|
224
224
|
});
|
|
225
225
|
Object.defineProperty(this, "processUpdatesQueue", {
|
|
226
226
|
enumerable: true,
|
|
227
227
|
configurable: true,
|
|
228
228
|
writable: true,
|
|
229
|
-
value: new Queue()
|
|
229
|
+
value: new Queue("processUpdates")
|
|
230
230
|
});
|
|
231
231
|
Object.defineProperty(this, "handler", {
|
|
232
232
|
enumerable: true,
|
|
@@ -578,7 +578,7 @@ export class Client extends ClientAbstract {
|
|
|
578
578
|
body = new TLReader(gunzip(body.packedData)).readObject();
|
|
579
579
|
}
|
|
580
580
|
dRecv("received %s", body.constructor.name);
|
|
581
|
-
if (body instanceof types.
|
|
581
|
+
if (body instanceof types._TypeUpdates || body instanceof types._TypeUpdate) {
|
|
582
582
|
this.processUpdatesQueue.add(() => this.processUpdates(body));
|
|
583
583
|
}
|
|
584
584
|
else if (message.body instanceof RPCResult) {
|
|
@@ -605,7 +605,7 @@ export class Client extends ClientAbstract {
|
|
|
605
605
|
this.promises.delete(messageId);
|
|
606
606
|
}
|
|
607
607
|
};
|
|
608
|
-
if (result instanceof types.
|
|
608
|
+
if (result instanceof types._TypeUpdates || result instanceof types._TypeUpdate) {
|
|
609
609
|
this.processUpdatesQueue.add(async () => {
|
|
610
610
|
await this.processUpdates(result);
|
|
611
611
|
resolvePromise();
|
|
@@ -709,7 +709,7 @@ export class Client extends ClientAbstract {
|
|
|
709
709
|
await this.storage.updateUsernames("channel", chat.id, [chat.username]);
|
|
710
710
|
}
|
|
711
711
|
if (chat.usernames) {
|
|
712
|
-
await this.storage.updateUsernames("channel", chat.id, chat.usernames.map((v) => v
|
|
712
|
+
await this.storage.updateUsernames("channel", chat.id, chat.usernames.map((v) => v.username));
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
715
|
else if (chat instanceof types.Chat) {
|
|
@@ -726,7 +726,7 @@ export class Client extends ClientAbstract {
|
|
|
726
726
|
await this.storage.updateUsernames("user", user.id, [user.username]);
|
|
727
727
|
}
|
|
728
728
|
if (user.usernames) {
|
|
729
|
-
await this.storage.updateUsernames("user", user.id, user.usernames.map((v) => v
|
|
729
|
+
await this.storage.updateUsernames("user", user.id, user.usernames.map((v) => v.username));
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
732
|
}
|
|
@@ -780,7 +780,7 @@ export class Client extends ClientAbstract {
|
|
|
780
780
|
await this.recoverUpdateGap("updatesTooLong");
|
|
781
781
|
return;
|
|
782
782
|
}
|
|
783
|
-
else if (updates_ instanceof types.
|
|
783
|
+
else if (updates_ instanceof types._TypeUpdate) {
|
|
784
784
|
updates = [updates_];
|
|
785
785
|
}
|
|
786
786
|
else {
|
|
@@ -859,7 +859,7 @@ export class Client extends ClientAbstract {
|
|
|
859
859
|
await this.recoverChannelUpdateGap(update.channelId, "updateChannelTooLong");
|
|
860
860
|
}
|
|
861
861
|
else if (update instanceof types.UpdateUserName) {
|
|
862
|
-
await this.storage.updateUsernames("user", update.userId, update.usernames.map((v) => v
|
|
862
|
+
await this.storage.updateUsernames("user", update.userId, update.usernames.map((v) => v.username));
|
|
863
863
|
}
|
|
864
864
|
else if (update instanceof types.UpdatePtsChanged) {
|
|
865
865
|
await this.fetchState("updatePtsChanged");
|
|
@@ -871,7 +871,7 @@ export class Client extends ClientAbstract {
|
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
873
|
/// If there were any Update, they will be passed to the update handling queue.
|
|
874
|
-
if (update instanceof types.
|
|
874
|
+
if (update instanceof types._TypeUpdate) {
|
|
875
875
|
updatesToHandle.push(update);
|
|
876
876
|
}
|
|
877
877
|
}
|
|
@@ -923,12 +923,12 @@ export class Client extends ClientAbstract {
|
|
|
923
923
|
await this.processUpdates(update, true);
|
|
924
924
|
}
|
|
925
925
|
if (difference instanceof types.UpdatesDifference) {
|
|
926
|
-
await this.storage.setState(difference.state
|
|
926
|
+
await this.storage.setState(difference.state);
|
|
927
927
|
dGap("recovered from update gap");
|
|
928
928
|
break;
|
|
929
929
|
}
|
|
930
930
|
else if (difference instanceof types.UpdatesDifferenceSlice) {
|
|
931
|
-
state = difference.intermediateState
|
|
931
|
+
state = difference.intermediateState;
|
|
932
932
|
}
|
|
933
933
|
else {
|
|
934
934
|
UNREACHABLE();
|
|
@@ -1381,7 +1381,7 @@ export class Client extends ClientAbstract {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
else {
|
|
1383
1383
|
const stickerSet = await this.invoke(new functions.MessagesGetStickerSet({ stickerset: inputStickerSet, hash }));
|
|
1384
|
-
const name = stickerSet[as](types.MessagesStickerSet).set
|
|
1384
|
+
const name = stickerSet[as](types.MessagesStickerSet).set.shortName;
|
|
1385
1385
|
await this.storage.updateStickerSetName(inputStickerSet.id, inputStickerSet.accessHash, name);
|
|
1386
1386
|
return name;
|
|
1387
1387
|
}
|
package/esm/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
|
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 161;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.990";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/esm/constants.js
CHANGED
|
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
54
54
|
export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
55
55
|
export const INITIAL_DC = "2-test";
|
|
56
56
|
export const LAYER = 161;
|
|
57
|
-
export const APP_VERSION = "MTKruto 0.0.
|
|
57
|
+
export const APP_VERSION = "MTKruto 0.0.990";
|
|
58
58
|
// @ts-ignore: lib
|
|
59
59
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
60
60
|
export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|