公告和资讯推送随机延迟1-180秒 (#48)

This commit is contained in:
2023-04-04 03:25:29 +08:00 committed by GitHub
parent 2e3a9f4987
commit 972ddfc492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -351,7 +351,9 @@ export default class MysNews extends base {
tmp = [`原神${typeName}推送\n`, tmp] 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) await this.e.group.sendMsg(tmp)
} }
} }