mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
34 lines
798 B
JavaScript
34 lines
798 B
JavaScript
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)
|
|
return false
|
|
}
|
|
|
|
async turnOffConfirm (e) {
|
|
await redis.set('CHATGPT:CONFIRM', 'off')
|
|
await this.reply('已关闭消息确认', true)
|
|
return false
|
|
}
|
|
}
|