From 560ed31860a420dcc43571d2e12dd2f51bcee7a8 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 1 Sep 2021 22:19:41 -0400 Subject: cleanup --- src/commands/moulberry-bush/capes.ts | 12 ++++---- src/commands/moulberry-bush/moulHammer.ts | 38 ++++++++++++++++++++++++ src/commands/moulberry-bush/moulHammerCommand.ts | 38 ------------------------ 3 files changed, 45 insertions(+), 43 deletions(-) create mode 100644 src/commands/moulberry-bush/moulHammer.ts delete mode 100644 src/commands/moulberry-bush/moulHammerCommand.ts (limited to 'src/commands/moulberry-bush') diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index c8d1a05..447d604 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -49,7 +49,6 @@ export default class CapesCommand extends BushCommand { default: null } ], - clientPermissions: ['EMBED_LINKS', 'SEND_MESSAGES'], slash: true, slashOptions: [ { @@ -58,7 +57,9 @@ export default class CapesCommand extends BushCommand { type: 'STRING', required: false } - ] + ], + clientPermissions: ['EMBED_LINKS', 'SEND_MESSAGES'], + userPermissions: ['SEND_MESSAGES'] }); } @@ -73,17 +74,17 @@ export default class CapesCommand extends BushCommand { })) .filter((f) => f.match !== null); - const capes1: { name: string; url: string; index: number }[] = []; + const capes1: { name: string; url: string; index: number; purchasable?: boolean }[] = []; client.consts.mappings.capes.forEach((mapCape) => { if (!capes.some((gitCape) => gitCape.match!.groups!.name === mapCape.name) && mapCape.custom) { - capes1.push({ name: mapCape.name, url: mapCape.custom, index: mapCape.index }); + capes1.push({ name: mapCape.name, url: mapCape.custom, index: mapCape.index, purchasable: mapCape.purchasable }); } }); capes.forEach((gitCape) => { const mapCape = client.consts.mappings.capes.find((a) => a.name === gitCape.match!.groups!.name); const url = mapCape?.custom ?? `https://github.com/Moulberry/NotEnoughUpdates/raw/master/${gitCape.f.path}`; const index = mapCape?.index !== undefined ? mapCape.index : null; - capes1.push({ name: gitCape.match!.groups!.name, url, index: index! }); + capes1.push({ name: gitCape.match!.groups!.name, url, index: index!, purchasable: mapCape?.purchasable }); }); const sortedCapes = capes1.sort((a, b) => { @@ -123,6 +124,7 @@ export default class CapesCommand extends BushCommand { color: util.colors.default }).setTimestamp(); embed.setImage(capeObj.url); + if (capeObj.purchasable) embed.setDescription(':money_with_wings: **purchasable** :money_with_wings:'); embeds.push(embed); } await util.buttonPaginate(message, embeds, null); diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts new file mode 100644 index 0000000..bc60372 --- /dev/null +++ b/src/commands/moulberry-bush/moulHammer.ts @@ -0,0 +1,38 @@ +import { MessageEmbed, User } from 'discord.js'; +import { BushCommand, BushMessage } from '../../lib'; + +export default class MoulHammerCommand extends BushCommand { + public constructor() { + super('moulHammer', { + aliases: ['moulhammer'], + category: "Moulberry's Bush", + description: { + content: 'A command to moul hammer members.', + usage: 'moulHammer ', + examples: ['moulHammer @IRONM00N'] + }, + clientPermissions: ['EMBED_LINKS', 'SEND_MESSAGES'], + userPermissions: ['SEND_MESSAGES'], + args: [ + { + id: 'user', + type: 'user', + prompt: { + start: 'What user would you like to moul hammer?', + retry: '{error} Choose a valid user to moul hammer' + } + } + ], + restrictedGuilds: ['516977525906341928'] + }); + } + + public override async exec(message: BushMessage, { user }: { user: User }): Promise { + await message.delete(); + const embed = new MessageEmbed() + .setTitle('L') + .setDescription(`${user.username} got moul'ed <:wideberry1:756223352598691942><:wideberry2:756223336832303154>`) + .setColor(this.client.util.colors.purple); + await message.util.send({ embeds: [embed] }); + } +} diff --git a/src/commands/moulberry-bush/moulHammerCommand.ts b/src/commands/moulberry-bush/moulHammerCommand.ts deleted file mode 100644 index bc60372..0000000 --- a/src/commands/moulberry-bush/moulHammerCommand.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MessageEmbed, User } from 'discord.js'; -import { BushCommand, BushMessage } from '../../lib'; - -export default class MoulHammerCommand extends BushCommand { - public constructor() { - super('moulHammer', { - aliases: ['moulhammer'], - category: "Moulberry's Bush", - description: { - content: 'A command to moul hammer members.', - usage: 'moulHammer ', - examples: ['moulHammer @IRONM00N'] - }, - clientPermissions: ['EMBED_LINKS', 'SEND_MESSAGES'], - userPermissions: ['SEND_MESSAGES'], - args: [ - { - id: 'user', - type: 'user', - prompt: { - start: 'What user would you like to moul hammer?', - retry: '{error} Choose a valid user to moul hammer' - } - } - ], - restrictedGuilds: ['516977525906341928'] - }); - } - - public override async exec(message: BushMessage, { user }: { user: User }): Promise { - await message.delete(); - const embed = new MessageEmbed() - .setTitle('L') - .setDescription(`${user.username} got moul'ed <:wideberry1:756223352598691942><:wideberry2:756223336832303154>`) - .setColor(this.client.util.colors.purple); - await message.util.send({ embeds: [embed] }); - } -} -- cgit