wx2tg-puppet 2.0.2 → 2.0.4

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.js CHANGED
@@ -383,7 +383,7 @@ class WxBot extends events_1.EventEmitter {
383
383
  if (config) {
384
384
  const res = yield LoginApi_1.loginApi.LogOut(config.wxid);
385
385
  }
386
- config_service_1.configService.delete();
386
+ config_service_1.configService.clear();
387
387
  room_service_1.roomService.clear();
388
388
  contact_service_1.contactService.clear();
389
389
  message_service_1.messageService.clear();
@@ -407,8 +407,8 @@ class WxBot extends events_1.EventEmitter {
407
407
  this.clearAllIntervals(); // 确保清理所有定时器
408
408
  const config = yield config_service_1.configService.get();
409
409
  if (config && config.wxid) {
410
- const resp = yield LoginApi_1.loginApi.GetCacheInfo(config.wxid);
411
- if (resp.data.Success) {
410
+ const resp = yield MsgApi_1.msgApi.Sync(config.wxid);
411
+ if (resp.data.Code === 0) {
412
412
  yield this.loginSuccess(config.wxid);
413
413
  }
414
414
  else {
@@ -3,7 +3,7 @@ declare class ConfigService {
3
3
  private get repo();
4
4
  get(): Promise<Config | null>;
5
5
  save(config: Partial<Config>): Promise<Config>;
6
- delete(): Promise<void>;
6
+ clear(): Promise<void>;
7
7
  }
8
8
  export declare const configService: ConfigService;
9
9
  export {};
@@ -34,12 +34,9 @@ class ConfigService {
34
34
  }
35
35
  });
36
36
  }
37
- delete() {
37
+ clear() {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
- const config = yield this.get();
40
- if (config) {
41
- yield this.repo.delete(config);
42
- }
39
+ yield this.repo.clear();
43
40
  });
44
41
  }
45
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wx2tg-puppet",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [