mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: Custom模式无效的问题;一些管理指令
This commit is contained in:
parent
d4f8b4318d
commit
1b4bc49612
3 changed files with 41 additions and 3 deletions
|
|
@ -754,9 +754,9 @@ export class chatgpt extends plugin {
|
||||||
cookies = bingToken
|
cookies = bingToken
|
||||||
}
|
}
|
||||||
let bingAIClient
|
let bingAIClient
|
||||||
if (Config.toneStyle === 'Sydney') {
|
if (Config.toneStyle === 'Sydney' || Config.toneStyle === 'Custom' ) {
|
||||||
const cacheOptions = {
|
const cacheOptions = {
|
||||||
namespace: 'Sydney',
|
namespace: Config.toneStyle,
|
||||||
store: new KeyvFile({ filename: 'cache.json' })
|
store: new KeyvFile({ filename: 'cache.json' })
|
||||||
}
|
}
|
||||||
bingAIClient = new SydneyAIClient({
|
bingAIClient = new SydneyAIClient({
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,16 @@ export class ChatgptManagement extends plugin {
|
||||||
fnc: 'useBingSolution',
|
fnc: 'useBingSolution',
|
||||||
permission: 'master'
|
permission: 'master'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
reg: '^#chatgpt(必应|Bing)切换',
|
||||||
|
fnc: 'changeBingTone',
|
||||||
|
permission: 'master'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
reg: '^#chatgpt(必应|Bing)(开启|关闭)建议(回复)?',
|
||||||
|
fnc: 'bingOpenSuggestedResponses',
|
||||||
|
permission: 'master'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
reg: '^#chatgpt模式(帮助)?$',
|
reg: '^#chatgpt模式(帮助)?$',
|
||||||
fnc: 'modeHelp'
|
fnc: 'modeHelp'
|
||||||
|
|
@ -233,6 +243,34 @@ export class ChatgptManagement extends plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async changeBingTone (e) {
|
||||||
|
let tongStyle = e.msg.replace(/^#chatgpt(必应|Bing)切换/, '')
|
||||||
|
if (!tongStyle) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let map = {
|
||||||
|
精准: 'precise',
|
||||||
|
创意: 'creative',
|
||||||
|
均衡: 'balanced',
|
||||||
|
Sydney: 'Sydney',
|
||||||
|
sydney: 'Sydney',
|
||||||
|
悉尼: 'Sydney',
|
||||||
|
自设定: 'Custom',
|
||||||
|
自定义: 'Custom'
|
||||||
|
}
|
||||||
|
if (map[tongStyle]) {
|
||||||
|
Config.toneStyle = map[tongStyle]
|
||||||
|
await e.reply('切换成功')
|
||||||
|
} else {
|
||||||
|
await e.reply('没有这种风格。支持的风格:精准、创意、均衡、悉尼、自设定')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async bingOpenSuggestedResponses (e) {
|
||||||
|
Config.enableSuggestedResponses = e.msg.indexOf('开启') > -1
|
||||||
|
await e.reply('操作成功')
|
||||||
|
}
|
||||||
|
|
||||||
async checkAuth (e) {
|
async checkAuth (e) {
|
||||||
if (!e.isMaster) {
|
if (!e.isMaster) {
|
||||||
e.reply(`只有主人才能命令ChatGPT哦~
|
e.reply(`只有主人才能命令ChatGPT哦~
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ const defaultConfig = {
|
||||||
initiativeChatGroups: [],
|
initiativeChatGroups: [],
|
||||||
enableDraw: true,
|
enableDraw: true,
|
||||||
helloPrompt: '写一段话让大家来找我聊天。类似于“有人找我聊天吗?"这种风格,轻松随意一点控制在20个字以内',
|
helloPrompt: '写一段话让大家来找我聊天。类似于“有人找我聊天吗?"这种风格,轻松随意一点控制在20个字以内',
|
||||||
version: 'v2.2.2'
|
version: 'v2.2.3'
|
||||||
}
|
}
|
||||||
const _path = process.cwd()
|
const _path = process.cwd()
|
||||||
let config = {}
|
let config = {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue