mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: add default md handler
This commit is contained in:
parent
2320453564
commit
89d1c3e287
2 changed files with 33 additions and 3 deletions
23
apps/md.js
Normal file
23
apps/md.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import plugin from '../../../lib/plugins/plugin.js'
|
||||
import cfg from '../../../lib/config/config.js'
|
||||
export class ChatGPTMarkdownHandler extends plugin {
|
||||
constructor () {
|
||||
super({
|
||||
name: 'chatgptmd处理器',
|
||||
priority: -100,
|
||||
namespace: 'chatgpt-plugin',
|
||||
handler: [{
|
||||
key: 'chatgpt.markdown.convert',
|
||||
fn: 'mdHandler'
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
async mdHandler (e, options, reject) {
|
||||
if (cfg.bot.global_md) {
|
||||
const { content, prompt, use } = options
|
||||
let md = `> ${prompt}\n\n---\n${content}\n\n---\n*当前模式:${use}*`
|
||||
return md
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue