Update db.ts

This commit is contained in:
po-lan 2024-05-28 22:30:26 +08:00 committed by GitHub
parent 66d60d3599
commit 16f926401b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -484,27 +484,25 @@ class DBUtil extends DBUtilBase {
userId: number, userId: number,
time: 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( async insertJoinTime(
groupId: number, groupId: number,
userId: number, userId: number,
time: number time: number
) { ) {
if (ob11Config.GroupLocalTimeRecord[0] == -1 || ob11Config.GroupLocalTimeRecord.includes(groupId)){ await this.createGroupInfoTimeTableIfNotExist(groupId);
await this.createGroupInfoTimeTableIfNotExist(groupId); this.db!.all(
this.db!.all( `INSERT OR REPLACE INTO "${groupId}" (user_id, last_sent_time, join_time) VALUES (?,?,?)`,
`INSERT OR REPLACE INTO "${groupId}" (user_id, last_sent_time, join_time) VALUES (?,?,?)`, [userId, time, time],
[userId, time, time], (err) => {
(err) => { if (err)
if (err) logError(err),
logError(err), Promise.reject(),
Promise.reject(), console.log("插入入群时间失败", userId, groupId);
console.log("插入入群时间失败", userId, groupId); }
} );
);
}
} }
} }