From 16f926401b9135db7aa0863cc6b0e5bad50ca05c Mon Sep 17 00:00:00 2001 From: po-lan <42771836+po-lan@users.noreply.github.com> Date: Tue, 28 May 2024 22:30:26 +0800 Subject: [PATCH] Update db.ts --- src/common/utils/db.ts | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/common/utils/db.ts b/src/common/utils/db.ts index 01df04ff..a200089d 100644 --- a/src/common/utils/db.ts +++ b/src/common/utils/db.ts @@ -484,27 +484,25 @@ class DBUtil extends DBUtilBase { userId: number, time: number ) { - if (ob11Config.GroupLocalTimeRecord[0] == -1 || ob11Config.GroupLocalTimeRecord.includes(groupId)) - this.LURCache.set(groupId, userId, time) + this.LURCache.set(groupId, userId, time) } async insertJoinTime( groupId: number, userId: number, time: number ) { - if (ob11Config.GroupLocalTimeRecord[0] == -1 || ob11Config.GroupLocalTimeRecord.includes(groupId)){ - await this.createGroupInfoTimeTableIfNotExist(groupId); - this.db!.all( - `INSERT OR REPLACE INTO "${groupId}" (user_id, last_sent_time, join_time) VALUES (?,?,?)`, - [userId, time, time], - (err) => { - if (err) - logError(err), - Promise.reject(), - console.log("插入入群时间失败", userId, groupId); - } - ); - } + await this.createGroupInfoTimeTableIfNotExist(groupId); + this.db!.all( + `INSERT OR REPLACE INTO "${groupId}" (user_id, last_sent_time, join_time) VALUES (?,?,?)`, + [userId, time, time], + (err) => { + if (err) + logError(err), + Promise.reject(), + console.log("插入入群时间失败", userId, groupId); + } + ); + } }