feat: use sqlite instead of lowdb

This commit is contained in:
ikechan8370 2025-04-09 16:27:21 +08:00
parent 9c41251164
commit fd197abb33
22 changed files with 3519 additions and 39 deletions

View file

@ -40,7 +40,7 @@ export class bym extends plugin {
let recall = false
let presetId = ChatGPTConfig.bym.defaultPreset
if (ChatGPTConfig.bym.presetMap && ChatGPTConfig.bym.presetMap.length > 0) {
const option = ChatGPTConfig.bym.presetMap.sort((a, b) => a.priority - b.priority)
const option = ChatGPTConfig.bym.presetMap.sort((a, b) => b.priority - a.priority)
.find(item => item.keywords.find(keyword => e.msg?.includes(keyword)))
if (option) {
presetId = option.presetId

View file

@ -1,7 +1,7 @@
import Config from '../config/config.js'
import { Chaite, SendMessageOption } from 'chaite'
import { getPreset, intoUserMessage, toYunzai } from '../utils/message.js'
import { YunzaiUserState } from '../models/chaite/user_state_storage.js'
import { YunzaiUserState } from '../models/chaite/storage/lowdb/user_state_storage.js'
import { getGroupContextPrompt, getGroupHistory } from '../utils/group.js'
import * as crypto from 'node:crypto'