Allow searching on /sendas via tag=

This commit is contained in:
Wolfsblvt
2024-09-15 19:20:43 +02:00
parent 4594353c72
commit 22d8a654d9
2 changed files with 56 additions and 14 deletions

View File

@ -193,7 +193,7 @@ export const commonEnumProviders = {
if (charName instanceof SlashCommandClosure) throw new Error('Argument \'name\' does not support closures');
const key = searchCharByName(substituteParams(charName), { suppressLogging: true });
const assigned = key ? getTagsList(key) : [];
return tags.filter(it => !key || mode === 'all' || mode === 'existing' && assigned.includes(it) || mode === 'not-existing' && !assigned.includes(it))
return tags.filter(it => mode === 'all' || mode === 'existing' && assigned.includes(it) || mode === 'not-existing' && !assigned.includes(it))
.map(tag => new SlashCommandEnumValue(tag.name, null, enumTypes.command, enumIcons.tag));
},