Add "quiet" to /char-find

This commit is contained in:
Wolfsblvt
2024-09-29 00:55:41 +02:00
parent 231ea98b25
commit 5a0e70e8fa

View File

@ -180,8 +180,9 @@ export function initDefaultSlashCommands() {
callback: (args, name) => {
if (typeof name !== 'string') throw new Error('name must be a string');
if (args.preferCurrent instanceof SlashCommandClosure || Array.isArray(args.preferCurrent)) throw new Error('preferCurrent cannot be a closure or array');
if (args.quiet instanceof SlashCommandClosure || Array.isArray(args.quiet)) throw new Error('quiet cannot be a closure or array');
const char = findChar({ name: name, filteredByTags: validateArrayArgString(args.tag, 'tag'), preferCurrentChar: isTrueBoolean(args.preferCurrent) });
const char = findChar({ name: name, filteredByTags: validateArrayArgString(args.tag, 'tag'), preferCurrentChar: isTrueBoolean(args.preferCurrent), quiet: isTrueBoolean(args.quiet) });
return char?.avatar ?? '';
},
returns: 'the avatar key (unique identifier) of the character',
@ -199,6 +200,13 @@ export function initDefaultSlashCommands() {
typeList: [ARGUMENT_TYPE.BOOLEAN],
defaultValue: 'true',
}),
SlashCommandNamedArgument.fromProps({
name: 'quiet',
description: 'Do not show warning if multiple charactrers are found',
typeList: [ARGUMENT_TYPE.BOOLEAN],
defaultValue: 'false',
enumProvider: commonEnumProviders.boolean('trueFalse'),
}),
],
unnamedArgumentList: [
SlashCommandArgument.fromProps({