wx2tg-puppet 2.2.4 → 2.2.5
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/dist/index.d.ts +1 -0
- package/dist/index.js +21 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export declare class WxBot extends EventEmitter {
|
|
|
61
61
|
clearCache(): Promise<void>;
|
|
62
62
|
login(): Promise<void>;
|
|
63
63
|
start(): Promise<void>;
|
|
64
|
+
loginTwice(): Promise<boolean>;
|
|
64
65
|
static get Contact(): typeof Contact;
|
|
65
66
|
get Contact(): typeof Contact;
|
|
66
67
|
static get Room(): typeof Room;
|
package/dist/index.js
CHANGED
|
@@ -661,6 +661,27 @@ class WxBot extends events_1.EventEmitter {
|
|
|
661
661
|
}
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
|
+
loginTwice() {
|
|
665
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
666
|
+
const config = yield config_service_1.configService.get();
|
|
667
|
+
if (!config) {
|
|
668
|
+
return false;
|
|
669
|
+
}
|
|
670
|
+
const resp = yield MsgApi_1.msgApi.Sync({
|
|
671
|
+
"Wxid": config === null || config === void 0 ? void 0 : config.wxid,
|
|
672
|
+
"Scene": 0,
|
|
673
|
+
"Synckey": ""
|
|
674
|
+
});
|
|
675
|
+
yield LoginApi_1.loginApi.LoginTwiceAutoAuth(config === null || config === void 0 ? void 0 : config.wxid);
|
|
676
|
+
if (yield this.checkSyncLoginStatus(resp.data, config === null || config === void 0 ? void 0 : config.wxid)) {
|
|
677
|
+
yield this.loginSuccess(config.wxid);
|
|
678
|
+
return true;
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
return false;
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
}
|
|
664
685
|
static get Contact() {
|
|
665
686
|
return Contact_1.Contact;
|
|
666
687
|
}
|