mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
Update db.ts
This commit is contained in:
parent
907b5611eb
commit
9954da22a6
@ -4,6 +4,7 @@ import sqlite3 from 'sqlite3';
|
|||||||
import { log, logDebug, logError } from '@/common/utils/log';
|
import { log, logDebug, logError } from '@/common/utils/log';
|
||||||
import { NTQQMsgApi } from '@/core';
|
import { NTQQMsgApi } from '@/core';
|
||||||
import LRU from "@/common/utils/LRUCache";
|
import LRU from "@/common/utils/LRUCache";
|
||||||
|
import { ob11Config } from '@/onebot11/config';
|
||||||
|
|
||||||
export interface IRember {
|
export interface IRember {
|
||||||
last_sent_time: number;
|
last_sent_time: number;
|
||||||
@ -483,6 +484,7 @@ 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(
|
||||||
@ -490,6 +492,7 @@ class DBUtil extends DBUtilBase {
|
|||||||
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 (?,?,?)`,
|
||||||
@ -502,6 +505,7 @@ class DBUtil extends DBUtilBase {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user