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

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