fix: 闭嘴功能

This commit is contained in:
ikechan8370 2023-03-06 20:30:57 +08:00
parent ce6559b644
commit 156a669ec6
5 changed files with 208 additions and 3 deletions

View file

@ -412,6 +412,11 @@ export class chatgpt extends plugin {
return false
}
}
let groupId = e.isGroup ? e.group.group_id : ''
if (await redis.get('CHATGPT:SHUT_UP:ALL') || await redis.get(`CHATGPT:SHUT_UP:${groupId}`)) {
logger.info('chatgpt闭嘴中不予理会')
return false
}
let userSetting = await redis.get(`CHATGPT:USER:${e.sender.user_id}`)
if (userSetting) {
userSetting = JSON.parse(userSetting)