mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
refactor(bym): ai不会骂人了
This commit is contained in:
parent
aee73e7683
commit
e291f3f630
1 changed files with 6 additions and 6 deletions
12
apps/bym.js
12
apps/bym.js
|
|
@ -154,9 +154,9 @@ export class bym extends plugin {
|
|||
if (opt.image && !IsAtBot && !NotToImg && !e.at && Config.AutoToDownImg) {
|
||||
ALLRole = 'downimg'
|
||||
}
|
||||
|
||||
|
||||
const ImgList = await fileImgList()
|
||||
|
||||
|
||||
const now = new Date();
|
||||
const DateTime = now.toLocaleString()
|
||||
let Dateday = now.getDay() === 0 ? '日' : now.getDay()
|
||||
|
|
@ -170,8 +170,9 @@ export class bym extends plugin {
|
|||
const txmod = [
|
||||
'"app":"com.tencent.multimsg","config"',
|
||||
'"app":"com.tencent.structmsg","config"'
|
||||
|
||||
|
||||
]
|
||||
let candidate = Config.bymPreset
|
||||
function replaceUserInput(input) {
|
||||
let result = input;
|
||||
for (let [key, value] of Object.entries(replaceWords)) {
|
||||
|
|
@ -183,7 +184,7 @@ export class bym extends plugin {
|
|||
if (e.msg) {
|
||||
const originalMsg = e.msg;
|
||||
const replacedMsg = replaceUserInput(e.msg);
|
||||
|
||||
|
||||
if (originalMsg !== replacedMsg) {
|
||||
e.msg = replacedMsg;
|
||||
}
|
||||
|
|
@ -192,7 +193,7 @@ export class bym extends plugin {
|
|||
if (Config.bymPreset.some(UserMsg => e.msg?.toLowerCase().includes(UserMsg.toLowerCase()))) {
|
||||
logger.info('!!!Bot被骂了,主动回击已经启动!!!')
|
||||
RecallMsg = true
|
||||
candidate = candidate + Config.bymFuckPrompt
|
||||
candidate += Config.bymFuckPrompt
|
||||
}
|
||||
|
||||
if (e.msg.length >= MaxText && !txmod.some(UserMsg => e.msg?.includes(UserMsg))) {
|
||||
|
|
@ -234,7 +235,6 @@ export class bym extends plugin {
|
|||
|
||||
let chats = await getChatHistoryGroup(e, ChatsList)
|
||||
|
||||
let candidate = Config.bymPreset
|
||||
chats = chats
|
||||
.filter(chat => !Config.returnQQ.includes(chat.user_id))
|
||||
.sort((a, b) => a.time - b.time);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue