From f81a09b081b21c14cabf491a011de43f411c3fd8 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 6 Feb 2022 21:21:04 -0500 Subject: make capes command autocomplete list first 25 capes if nothing is typed --- src/commands/moulberry-bush/capes.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/commands/moulberry-bush/capes.ts') diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index 0b2fcad..032f62d 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -114,7 +114,9 @@ export default class CapesCommand extends BushCommand { findAllMatches: true }).search(interaction.options.getFocused().toString()); - const res = fuzzy.slice(0, fuzzy.length >= 25 ? 25 : undefined).map((v) => ({ name: v.item, value: v.item })); + const res = (fuzzy.length ? fuzzy : capes.map((c) => ({ item: c }))) + .slice(0, fuzzy.length >= 25 ? 25 : undefined) + .map((v) => ({ name: v.item, value: v.item })); void interaction.respond(res); } -- cgit