From 972ddfc492d9226f41014a878ec4f1dbd2151474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=85?= <45375162+story-x@users.noreply.github.com> Date: Tue, 4 Apr 2023 03:25:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E5=92=8C=E8=B5=84=E8=AE=AF?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=9A=8F=E6=9C=BA=E5=BB=B6=E8=BF=9F1-180?= =?UTF-8?q?=E7=A7=92=20(#48)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/model/mysNews.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/genshin/model/mysNews.js b/plugins/genshin/model/mysNews.js index 353897e..913f2cf 100644 --- a/plugins/genshin/model/mysNews.js +++ b/plugins/genshin/model/mysNews.js @@ -351,7 +351,9 @@ export default class MysNews extends base { tmp = [`原神${typeName}推送\n`, tmp] } - redis.set(`${this.key}${groupId}:${postId}`, '1', { EX: 3600 * 10 }) + await redis.set(`${this.key}${groupId}:${postId}`, '1', { EX: 3600 * 10 }) + // 随机延迟1-180秒 + await common.sleep(lodash.random(1, 180) * 1000) await this.e.group.sendMsg(tmp) } }