修复bug和旧代码清理 (#553)

* fix: 修复星火api上下文

* 将无星火ck的情况降低为warn

* feat: 添加星火设定自定义代码功能

* 修复星火api模式的一些问题

* 修复导出配置问题

* feat:添加工具箱快捷登录接口

* 添加工具箱快捷登录指令

* 阻止群聊使用快捷登录

* 添加Azure配置支持,修复重复的配置项冲突

* 移除旧版本渲染和新版本帮助

* 添加工具箱

* 更新工具箱替换原有后台

* 更新工具箱适配代码
This commit is contained in:
HalcyonAlcedo 2023-09-08 12:28:02 +08:00 committed by GitHub
parent 043b80ddd4
commit bf761c24da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
183 changed files with 1206 additions and 7675 deletions

View file

@ -1,6 +1,6 @@
import plugin from '../../../lib/plugins/plugin.js'
import { Config } from '../utils/config.js'
import { render, renderUrl } from '../utils/common.js'
import { render } from '../utils/common.js'
let version = Config.version
let helpData = [
{
@ -326,25 +326,12 @@ export class help extends plugin {
{
reg: '^#(chatgpt|ChatGPT)(命令|帮助|菜单|help|说明|功能|指令|使用说明)$',
fnc: 'help'
},
{
reg: '^#帮助-',
fnc: 'newHelp'
}
]
})
}
async help (e) {
if (Config.newhelp && !Config.oldview) {
await renderUrl(e, `http://127.0.0.1:${Config.serverPort || 3321}/help/`, { Viewport: { width: 800, height: 600 } })
} else {
await render(e, 'chatgpt-plugin', 'help/index', { helpData, version })
}
}
async newHelp (e) {
let use = e.msg.replace(/^#帮助-/, '').toUpperCase().trim()
await renderUrl(e, `http://127.0.0.1:${Config.serverPort || 3321}/help/` + use, { Viewport: { width: 800, height: 600 } })
await render(e, 'chatgpt-plugin', 'help/index', { helpData, version })
}
}