Allow case-insensitive name search

d8e57c507f0243d6888936011d2c5c9a8698f94a

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +3 -3Showing whitespace changes
public/scripts/slash-commands.js+3 -3
@@ -55,7 +55,7 @@ import { autoSelectPersona, retriggerFirstMessageOnEmptyChat, setPersonaLockStat
55import { addEphemeralStoppingString, chat_styles, flushEphemeralStoppingStrings, power_user } from './power-user.js';55import { addEphemeralStoppingString, chat_styles, flushEphemeralStoppingStrings, power_user } from './power-user.js';
56import { SERVER_INPUTS, textgen_types, textgenerationwebui_settings } from './textgen-settings.js';56import { SERVER_INPUTS, textgen_types, textgenerationwebui_settings } from './textgen-settings.js';
57import { decodeTextTokens, getAvailableTokenizers, getFriendlyTokenizerName, getTextTokens, getTokenCountAsync, selectTokenizer } from './tokenizers.js';57import { decodeTextTokens, getAvailableTokenizers, getFriendlyTokenizerName, getTextTokens, getTokenCountAsync, selectTokenizer } from './tokenizers.js';
58import { debounce, delay, isFalseBoolean, isTrueBoolean, showFontAwesomePicker, stringToRange, trimToEndSentence, trimToStartSentence, waitUntilCondition } from './utils.js';58import { debounce, delay, equalsIgnoreCaseAndAccents, isFalseBoolean, isTrueBoolean, showFontAwesomePicker, stringToRange, trimToEndSentence, trimToStartSentence, waitUntilCondition } from './utils.js';
59import { registerVariableCommands, resolveVariable } from './variables.js';59import { registerVariableCommands, resolveVariable } from './variables.js';
60import { background_settings } from './backgrounds.js';60import { background_settings } from './backgrounds.js';
61import { SlashCommandClosure } from './slash-commands/SlashCommandClosure.js';61import { SlashCommandClosure } from './slash-commands/SlashCommandClosure.js';
@@ -3141,7 +3141,7 @@ export async function sendMessageAs(args, text) {
3141 const chatCharacter = this_chid !== undefined ? characters[this_chid] : null;3141 const chatCharacter = this_chid !== undefined ? characters[this_chid] : null;
3142 const isNeutralCharacter = !chatCharacter && name2 === neutralCharacterName && name === neutralCharacterName;3142 const isNeutralCharacter = !chatCharacter && name2 === neutralCharacterName && name === neutralCharacterName;
31433143
3144 const character = chatCharacter.name === name ? chatCharacter : characters.find(x => x.name === name);3144 const character = equalsIgnoreCaseAndAccents(chatCharacter.name, name) ? chatCharacter : characters.find(x => equalsIgnoreCaseAndAccents(x.name, name));
3145 let force_avatar, original_avatar;3145 let force_avatar, original_avatar;
31463146
3147 if (chatCharacter === character || isNeutralCharacter) {3147 if (chatCharacter === character || isNeutralCharacter) {
@@ -3157,7 +3157,7 @@ export async function sendMessageAs(args, text) {
3157 }3157 }
31583158
3159 const message = {3159 const message = {
3160 name: name,3160 name: character?.name || name,
3161 is_user: false,3161 is_user: false,
3162 is_system: isSystem,3162 is_system: isSystem,
3163 send_date: getMessageTimeStamp(),3163 send_date: getMessageTimeStamp(),