mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-15 11:30:09 +01:00
Allow finding characters in slash commands by exact PNG name
This commit is contained in:
parent
106cdf3aed
commit
a8cd6c9fe7
@ -1119,6 +1119,12 @@ function findCharacterIndex(name) {
|
||||
(a, b) => a.includes(b),
|
||||
];
|
||||
|
||||
const exactAvatarMatch = characters.findIndex(x => x.avatar === name);
|
||||
|
||||
if (exactAvatarMatch !== -1) {
|
||||
return exactAvatarMatch;
|
||||
}
|
||||
|
||||
for (const matchType of matchTypes) {
|
||||
const index = characters.findIndex(x => matchType(x.name.toLowerCase(), name.toLowerCase()));
|
||||
if (index !== -1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user