Add "quiet" to /char-find

5a0e70e8fa377ca9cf6e9671c748852ef17e1de0

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +9 -1Ignore whitespace
public/scripts/slash-commands.js+9 -1
@@ -180,8 +180,9 @@ export function initDefaultSlashCommands() {
180 callback: (args, name) => {180 callback: (args, name) => {
181 if (typeof name !== 'string') throw new Error('name must be a string');181 if (typeof name !== 'string') throw new Error('name must be a string');
182 if (args.preferCurrent instanceof SlashCommandClosure || Array.isArray(args.preferCurrent)) throw new Error('preferCurrent cannot be a closure or array');182 if (args.preferCurrent instanceof SlashCommandClosure || Array.isArray(args.preferCurrent)) throw new Error('preferCurrent cannot be a closure or array');
183 if (args.quiet instanceof SlashCommandClosure || Array.isArray(args.quiet)) throw new Error('quiet cannot be a closure or array');
183184
184 const char = findChar({ name: name, filteredByTags: validateArrayArgString(args.tag, 'tag'), preferCurrentChar: isTrueBoolean(args.preferCurrent) });185 const char = findChar({ name: name, filteredByTags: validateArrayArgString(args.tag, 'tag'), preferCurrentChar: isTrueBoolean(args.preferCurrent), quiet: isTrueBoolean(args.quiet) });
185 return char?.avatar ?? '';186 return char?.avatar ?? '';
186 },187 },
187 returns: 'the avatar key (unique identifier) of the character',188 returns: 'the avatar key (unique identifier) of the character',
@@ -199,6 +200,13 @@ export function initDefaultSlashCommands() {
199 typeList: [ARGUMENT_TYPE.BOOLEAN],200 typeList: [ARGUMENT_TYPE.BOOLEAN],
200 defaultValue: 'true',201 defaultValue: 'true',
201 }),202 }),
203 SlashCommandNamedArgument.fromProps({
204 name: 'quiet',
205 description: 'Do not show warning if multiple charactrers are found',
206 typeList: [ARGUMENT_TYPE.BOOLEAN],
207 defaultValue: 'false',
208 enumProvider: commonEnumProviders.boolean('trueFalse'),
209 }),
202 ],210 ],
203 unnamedArgumentList: [211 unnamedArgumentList: [
204 SlashCommandArgument.fromProps({212 SlashCommandArgument.fromProps({