aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush/capes.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-06 21:21:04 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-06 21:21:04 -0500
commitf81a09b081b21c14cabf491a011de43f411c3fd8 (patch)
tree262e6c2c5084facf735a3c8bc83858055bc3fa38 /src/commands/moulberry-bush/capes.ts
parent0e717d9e5c35d72bc9e5ba1b4fc6d3e0ac286e9b (diff)
downloadtanzanite-f81a09b081b21c14cabf491a011de43f411c3fd8.tar.gz
tanzanite-f81a09b081b21c14cabf491a011de43f411c3fd8.tar.bz2
tanzanite-f81a09b081b21c14cabf491a011de43f411c3fd8.zip
make capes command autocomplete list first 25 capes if nothing is typed
Diffstat (limited to 'src/commands/moulberry-bush/capes.ts')
-rw-r--r--src/commands/moulberry-bush/capes.ts4
1 files changed, 3 insertions, 1 deletions
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);
}