mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Messages + Instruct: Fix /send with name= if name is empty
If name is empty, don't try appending it to the message. This applies for both instruct and non-instruct modes. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@ -340,8 +340,11 @@ export function formatInstructModeChat(name, mes, isUser, isNarrator, forceAvata
|
||||
}
|
||||
|
||||
const separator = power_user.instruct.wrap ? '\n' : '';
|
||||
const textArray = includeNames ? [prefix, `${name}: ${mes}` + suffix] : [prefix, mes + suffix];
|
||||
|
||||
// Don't include the name if it's empty
|
||||
const textArray = includeNames && name ? [prefix, `${name}: ${mes}` + suffix] : [prefix, mes + suffix];
|
||||
const text = textArray.filter(x => x).join(separator);
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user