diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-01 22:19:41 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-09-01 22:19:41 -0400 |
commit | 560ed31860a420dcc43571d2e12dd2f51bcee7a8 (patch) | |
tree | 855e0cb50c550bbff63ab675e1102b7608573668 /src/commands/moulberry-bush/capes.ts | |
parent | 855aa36c46e250fd3063eb200d784903a8c388d3 (diff) | |
download | tanzanite-560ed31860a420dcc43571d2e12dd2f51bcee7a8.tar.gz tanzanite-560ed31860a420dcc43571d2e12dd2f51bcee7a8.tar.bz2 tanzanite-560ed31860a420dcc43571d2e12dd2f51bcee7a8.zip |
cleanup
Diffstat (limited to 'src/commands/moulberry-bush/capes.ts')
-rw-r--r-- | src/commands/moulberry-bush/capes.ts | 12 |
1 files changed, 7 insertions, 5 deletions
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); |