fix: ignore md while not enable md

This commit is contained in:
ikechan8370 2024-03-05 13:52:45 +08:00
parent 2ae751e6e7
commit 766420e652
3 changed files with 12 additions and 3 deletions

View file

@ -292,6 +292,9 @@ export class chatgpt extends plugin {
})
this.toggleMode = toggleMode
this.reply = async (msg, quote, data) => {
if (!Config.enableMd) {
return e.reply(msg, quote, data)
}
let handler = e.runtime?.handler || {}
const btns = await handler.call('chatgpt.button.post', this.e, data)
const btnElement = {
@ -303,7 +306,7 @@ export class chatgpt extends plugin {
} else {
msg = [msg, btnElement]
}
return e.reply(msg, data)
return e.reply(msg, quote, data)
}
}

View file

@ -83,6 +83,9 @@ export class Entertainment extends plugin {
}
]
this.reply = async (msg, quote, data) => {
if (!Config.enableMd) {
return e.reply(msg, quote, data)
}
let handler = e.runtime?.handler || {}
const btns = await handler.call('chatgpt.button.post', this.e)
const btnElement = {
@ -94,7 +97,7 @@ export class Entertainment extends plugin {
} else {
msg = [msg, btnElement]
}
return e.reply(msg, data)
return e.reply(msg, quote, data)
}
}

View file

@ -334,6 +334,9 @@ export class ChatgptManagement extends plugin {
]
})
this.reply = async (msg, quote, data) => {
if (!Config.enableMd) {
return e.reply(msg, quote, data)
}
let handler = e.runtime?.handler || {}
const btns = await handler.call('chatgpt.button.post', this.e)
if (btns) {
@ -347,7 +350,7 @@ export class ChatgptManagement extends plugin {
msg = [msg, btnElement]
}
}
return e.reply(msg, data)
return e.reply(msg, quote, data)
}
}