fix: 增加指令切换翻译源

This commit is contained in:
ikechan8370 2024-02-23 00:32:36 +08:00
parent 35ad437df2
commit 4886042e3c

View file

@ -59,6 +59,10 @@ export class Entertainment extends plugin {
reg: '^#((寄批踢|gpt|GPT)?翻[sS]*|chatgpt翻译帮助)',
fnc: 'translate'
},
{
reg: '^#(chatgpt)?(设置|修改)翻译来源(openai|gemini|星火|通义千问|xh|qwen)$',
fnc: 'translateSource'
},
{
reg: '^#ocr',
fnc: 'ocr'
@ -187,6 +191,23 @@ ${translateLangLabels}
return true
}
translateSource (e) {
let command = e.msg
if (command.includes('openai')) {
Config.translateSource = 'openai'
} else if (command.msg.includes('gemini')) {
Config.translateSource = 'gemini'
} else if (command.msg.includes('星火')) {
Config.translateSource = 'xh'
} else if (command.msg.includes('通义千问')) {
Config.translateSource = 'qwen'
} else if (command.msg.includes('xh')) {
Config.translateSource = 'xh'
} else if (command.msg.includes('qwen')) {
Config.translateSource = 'qwen'
}
}
async wordcloud (e) {
if (e.isGroup) {
let groupId = e.group_id