fix: button

This commit is contained in:
ikechan8370 2024-03-08 14:44:42 +08:00
parent f0c284cc2f
commit b4e017a69d
2 changed files with 13 additions and 8 deletions

View file

@ -13,6 +13,7 @@ const FUNCTION_XH = 'xh'
const FUNCTION_QWEN = 'qwen'
const FUNCTION_GLM4 = 'glm4'
const FUNCTION_CLAUDE2 = 'claude2'
const FUNCTION_CLAUDE = 'claude'
const FUNCTION_END = 'destroyConversations'
const FUNCTION_END_ALL = 'endAllConversations'
@ -66,6 +67,7 @@ export class ChatGPTButtonHandler extends plugin {
case `[${PLUGIN_CHAT}][${FUNCTION_XH}]`:
case `[${PLUGIN_CHAT}][${FUNCTION_QWEN}]`:
case `[${PLUGIN_CHAT}][${FUNCTION_CLAUDE2}]`:
case `[${PLUGIN_CHAT}][${FUNCTION_CLAUDE}]`:
case `[${PLUGIN_CHAT}][${FUNCTION_GLM4}]`:
case `[${PLUGIN_CHAT}][${FUNCTION_CHAT}]`: {
return this.makeButtonChat(options?.btnData)

View file

@ -290,6 +290,7 @@ export class chatgpt extends plugin {
}
let handler = e.runtime?.handler || {}
const btns = await handler.call('chatgpt.button.post', this.e, data)
if (btns) {
const btnElement = {
type: 'button',
content: btns
@ -299,6 +300,8 @@ export class chatgpt extends plugin {
} else {
msg = [msg, btnElement]
}
}
return e.reply(msg, quote, data)
}
}