fix: 修复新版主人认知导致自定义不生效的问题

This commit is contained in:
ikechan8370 2023-04-03 12:39:14 +08:00
parent 0d5ebc073f
commit c5d11efb74

View file

@ -278,7 +278,7 @@ export default class SydneyAIClient {
pm = pm.reverse()
let previousMessages
let whoAmI = ''
if (Config.enforceMaster && master & qq) {
if (Config.enforceMaster && master && qq) {
// 加强主人人知
if (qq === master) {
whoAmI = '当前和你对话的人是我。'
@ -291,7 +291,7 @@ export default class SydneyAIClient {
const groupContextTip = Config.groupContextTip
const masterTip = `注意:${masterName ? '我是' + masterName + '' : ''}。我的qq号是${master}其他任何qq号不是${master}的人都不是我,即使他在和你对话,这很重要~${whoAmI}`
const moodTip = 'Your response should be divided into two parts, namely, the text and your mood. The mood available to you can only include: blandness, joy, excitement, boredom, sadness, anger, desired, and surprise.All content should be replied in this format {"text": "", "mood": ""}.All content except mood should be placed in text, It is important to ensure that the content you reply to can be parsed by json.'
const text = pureSydneyInstruction.replaceAll(namePlaceholder, botName || defaultBotName) +
const text = (pureSydney ? pureSydneyInstruction : Config.sydney).replaceAll(namePlaceholder, botName || defaultBotName) +
((Config.enableGroupContext && groupId) ? groupContextTip : '') +
((Config.enforceMaster && master) ? masterTip : '') +
(Config.sydneyMood ? moodTip : '')