mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: button
This commit is contained in:
parent
f0c284cc2f
commit
b4e017a69d
2 changed files with 13 additions and 8 deletions
19
apps/chat.js
19
apps/chat.js
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue