Skip to content

Let's use AI to Earn!

feat: 评论回复增加延时

yikaJasonMic70c5b9159b8a
diff --git a/electron-builder.json b/electron-builder.json
index cbbe9d5a..a19d5361 100644
--- a/electron-builder.json
+++ b/electron-builder.json
@@ -7,7 +7,6 @@
"output": "release/${version}"
},
"files": ["dist-electron", "dist"],
- "beforePack": "scripts/cleanup-ffmpeg.cjs",
"mac": {
"identity": null,
"artifactName": "${productName}-${version}-${arch}.${ext}",
diff --git a/electron/main/controller.ts b/electron/main/controller.ts
index dc2c5fee..bca2738f 100644
--- a/electron/main/controller.ts
+++ b/electron/main/controller.ts
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-01-20 22:02:54
- * @LastEditTime: 2025-02-21 21:16:01
+ * @LastEditTime: 2025-03-31 11:30:32
* @LastEditors: nevin
* @Description:
*/
@@ -20,12 +20,4 @@ export class AppController {
async getAppInfo(event: Electron.IpcMainInvokeEvent) {
return this.toolsService.getAppInfo();
}
-
- /**
- * 指定chromium路径
- */
- @Icp('ICP_SET_CHROMIUM_PATH')
- async setChromiumPath(event: Electron.IpcMainInvokeEvent) {
- return this.toolsService.setChromiumPath();
- }
}
diff --git a/electron/main/reply/service.ts b/electron/main/reply/service.ts
index cd6c84b6..4ed31946 100644
--- a/electron/main/reply/service.ts
+++ b/electron/main/reply/service.ts
@@ -20,6 +20,7 @@ import { getUserInfo } from '../user/comment';
import { AutoRunRecordStatus } from '../../db/models/autoRunRecord';
import { WorkData } from '../plat/plat.type';
import { GlobleCache } from '../../global/cache';
+import { sleep } from '../../util/time';
/**
* 获取缓存key
@@ -137,6 +138,7 @@ export class ReplyService {
// 2. 循环AI回复评论
for (const element of list) {
+ sleep(5);
const oldRecord = await this.getReplyCommentRecord(
userInfo.id,
account,
diff --git a/electron/plat/coomont.ts b/electron/plat/coomont.ts
index 4c8bf2b8..8f7e73ec 100644
--- a/electron/plat/coomont.ts
+++ b/electron/plat/coomont.ts
@@ -1,9 +1,9 @@
/*
* @Author: nevin
* @Date: 2025-03-21 19:08:17
- * @LastEditTime: 2025-03-31 11:21:42
+ * @LastEditTime: 2025-03-31 11:29:54
* @LastEditors: nevin
- * @Description:
+ * @Description:
*/
import os from 'os';
import { Browser, chromium, webkit } from 'playwright';
diff --git a/electron/util/time.ts b/electron/util/time.ts
index f0a2d4c3..94587cee 100644
--- a/electron/util/time.ts
+++ b/electron/util/time.ts
@@ -1,7 +1,7 @@
/*
* @Author: nevin
* @Date: 2025-02-11 19:02:37
- * @LastEditTime: 2025-02-11 19:04:13
+ * @LastEditTime: 2025-03-31 11:39:35
* @LastEditors: nevin
* @Description: 时间工具类
*/
@@ -10,3 +10,7 @@ export function getNowTimeStamp(is13Bit: boolean = false): number {
const time = new Date().getTime();
return is13Bit ? time : Math.floor(time / 1000);
}
+
+export function sleep(ms: number) {
+ return new Promise((resolve) => setTimeout(resolve, ms));
+}