mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-24 09:00:06 +08:00
Update db.ts
通过读取缓存修复刚说话缺无法获取发言时间的问题
This commit is contained in:
parent
eb84e2f8c9
commit
a9f3e7fc54
@ -408,10 +408,12 @@ class DBUtil extends DBUtilBase {
|
||||
logDebug('读取发言时间', groupId);
|
||||
return new Promise<IRember[]>((resolve, reject) => {
|
||||
this.db!.all(`SELECT * FROM "${groupId}" `, (err, rows: IRember[]) => {
|
||||
const cache = this.LURCache.get(groupId).map(e=>({user_id:e.userId, last_sent_time:e.value}));
|
||||
if (err) {
|
||||
logError('查询发言时间失败', groupId);
|
||||
return resolve([]);
|
||||
return resolve(cache.map(e=>({...e, join_time:0})));
|
||||
}
|
||||
Object.assign(rows, cache)
|
||||
logDebug('查询发言时间成功', groupId, rows);
|
||||
resolve(rows);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user