mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
fix: 优化连续对话逻辑
This commit is contained in:
parent
b2b3d7b6c5
commit
da22a94259
1 changed files with 14 additions and 13 deletions
15
apps/bym.js
15
apps/bym.js
|
|
@ -51,17 +51,13 @@ export class bym extends plugin {
|
|||
|
||||
async _handleReply(e) {
|
||||
|
||||
if(Config.bymContinue){
|
||||
const delay = Config.bymContinueDelay || 10
|
||||
this.setContext("_handleContinue", false, delay, "")
|
||||
}
|
||||
|
||||
let sender = e.sender.user_id
|
||||
let card = e.sender.card || e.sender.nickname
|
||||
let group = e.group_id
|
||||
|
||||
let fuck = false
|
||||
let candidate = Config.bymPreset
|
||||
let delay = Config.bymContinueDelay || 10
|
||||
if (Config.bymFuckList?.find(i => e.msg?.includes(i))) {
|
||||
fuck = true
|
||||
candidate = candidate + Config.bymFuckPrompt
|
||||
|
|
@ -115,6 +111,11 @@ export class bym extends plugin {
|
|||
await this.reply(finalMsg, (this._genProp() < 10), {
|
||||
recallMsg: fuck ? 10 : 0
|
||||
})
|
||||
|
||||
if (Config.bymContinue) {
|
||||
this.finish("_handleContinue", false)
|
||||
this.setContext("_handleContinue", false, delay, "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -126,8 +127,8 @@ export class bym extends plugin {
|
|||
}
|
||||
|
||||
async _handleContinue(e) {
|
||||
logger.mark("bym继续对话")
|
||||
this.finish("_handleContinue", e.isGroup)
|
||||
logger.mark("bym continue")
|
||||
this.finish("_handleContinue", false)
|
||||
await this._handleReply(e)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue