添加SLACK CLAUDE配置 (#359)

* 修复后台API反代地址未能正确显示的问题

* 更新渲染页面配置

* 添加个人聊天模式配置

* 将用户数据获取改到common中

* 修复错误的渲染页面参数

* 修复bug

* 添加Live2D

* 修复渲染页面错误

* 修复渲染传入值

* 更新渲染

* 修复图表渲染bug

* 调整live2d模型大小

* 修复live2d无法关闭问题

* 修复错误的传值

* 修复ai命名

* 更新渲染

* 添加用户独立设定
This commit is contained in:
HalcyonAlcedo 2023-04-18 12:41:20 +08:00 committed by GitHub
parent 40b72989e4
commit e758b37d4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 1776 additions and 125 deletions

View file

@ -316,6 +316,7 @@ export async function renderUrl (e, url, renderCfg = {}) {
width: 1280,
height: 720
})
await page.waitForTimeout(renderCfg.wait || 1000)
let buff = base64 = await page.screenshot({ fullPage: true })
base64 = segment.image(buff)
await page.close().catch((err) => logger.error(err))
@ -610,3 +611,26 @@ export async function getPublicIP () {
return '127.0.0.1'
}
}
export async function getUserData (user) {
const dir = 'resources/ChatGPTCache/user'
const filename = `${user}.json`
const filepath = path.join(dir, filename)
try {
let data = fs.readFileSync(filepath, 'utf8')
return JSON.parse(data)
} catch (error) {
return {
user: user,
passwd: '',
chat: [],
mode: '',
cast: {
api: '', //API设定
bing: '', //必应设定
bing_resource: '', //必应扩展资料
slack: '', //Slack设定
}
}
}
}