feat: 提供了更多的可选配置项,包括确认开关、暗示指令覆盖、触发方式、模型名称和屏蔽词等

This commit is contained in:
ikechan8370 2023-02-08 21:09:55 +08:00
parent 35b7630d76
commit 233fc7417c
4 changed files with 97 additions and 20 deletions

32
apps/management.js Normal file
View file

@ -0,0 +1,32 @@
import plugin from '../../../lib/plugins/plugin.js'
export class ChatgptManagement extends plugin {
constructor (e) {
super({
name: 'ChatGPT-Plugin管理',
dsc: 'ChatGPT-Plugin管理',
event: 'message',
priority: 500,
rule: [
{
reg: '#chatgpt开启(问题)?确认',
fnc: 'turnOnConfirm'
},
{
reg: '#chatgpt关闭(问题)?确认',
fnc: 'turnOffConfirm'
}
]
})
}
async turnOnConfirm (e) {
await redis.set('CHATGPT:CONFIRM', 'on')
await this.reply('已开启消息确认', true)
}
async turnOffConfirm (e) {
await redis.set('CHATGPT:CONFIRM', 'off')
await this.reply('已关闭消息确认', true)
}
}