aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush/capes.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-16 14:32:18 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-16 14:32:18 -0400
commit0e87bbd3940d89defcb04926587b35c8f4d1947f (patch)
treee50860d4dc25a11d4c3977b583284c4bcad1b077 /src/commands/moulberry-bush/capes.ts
parent661e4c9935aeb8760dafc7ced4bbec6cc356a033 (diff)
downloadtanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.tar.gz
tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.tar.bz2
tanzanite-0e87bbd3940d89defcb04926587b35c8f4d1947f.zip
remove util classes, move config out of src
Diffstat (limited to 'src/commands/moulberry-bush/capes.ts')
-rw-r--r--src/commands/moulberry-bush/capes.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts
index 6bf7854..c2dae4d 100644
--- a/src/commands/moulberry-bush/capes.ts
+++ b/src/commands/moulberry-bush/capes.ts
@@ -2,7 +2,12 @@ import {
AllowedMentions,
BushCommand,
ButtonPaginator,
+ clientSendAndPermCheck,
+ colors,
DeleteButton,
+ emojis,
+ format,
+ mappings,
type CommandMessage,
type OptArgType,
type SlashMessage
@@ -36,7 +41,7 @@ export default class CapesCommand extends BushCommand {
}
],
slash: true,
- clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true),
+ clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true),
userPermissions: []
});
}
@@ -53,11 +58,11 @@ export default class CapesCommand extends BushCommand {
.filter((f) => f.match !== null);
const capes: { name: string; url: string; index: number; purchasable?: boolean }[] = [
- ...client.consts.mappings.capes
+ ...mappings.capes
.filter((c) => !rawCapes.some((gitCape) => gitCape.match!.groups!.name === c.name) && c.custom)
.map((c) => ({ name: c.name, url: c.custom!, index: c.index, purchasable: c.purchasable })),
...rawCapes.map((c) => {
- const mapCape = client.consts.mappings.capes.find((a) => a.name === c.match!.groups!.name);
+ const mapCape = mappings.capes.find((a) => a.name === c.match!.groups!.name);
const url = mapCape?.custom ?? `https://github.com/Moulberry/NotEnoughUpdates/raw/master/${c.f.path}`;
const index = mapCape?.index !== undefined ? mapCape.index : null;
return { name: c.match!.groups!.name, url, index: index!, purchasable: mapCape?.purchasable };
@@ -76,7 +81,7 @@ export default class CapesCommand extends BushCommand {
await DeleteButton.send(message, { embeds: [embed] });
} else {
await message.util.reply({
- content: `${util.emojis.error} Cannot find a cape called ${util.format.input(args.cape)}.`,
+ content: `${emojis.error} Cannot find a cape called ${format.input(args.cape)}.`,
allowedMentions: AllowedMentions.none()
});
}
@@ -89,7 +94,7 @@ export default class CapesCommand extends BushCommand {
private makeEmbed(cape: { name: string; url: string; index: number; purchasable?: boolean | undefined }): APIEmbed {
return {
title: `${cape.name} cape`,
- color: util.colors.default,
+ color: colors.default,
timestamp: new Date().toISOString(),
image: { url: cape.url },
description: cape.purchasable
@@ -99,7 +104,7 @@ export default class CapesCommand extends BushCommand {
}
public override autocomplete(interaction: AutocompleteInteraction) {
- const capes = client.consts.mappings.capes.map((v) => v.name);
+ const capes = mappings.capes.map((v) => v.name);
const fuzzy = new Fuse(capes, {
threshold: 0.5,