aboutsummaryrefslogtreecommitdiff
path: root/src/commands/utilities/price.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-24 18:29:57 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-24 18:29:57 -0400
commit9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c (patch)
tree4b95a06ff6991207ab8b8e93f0bca26e24a97f80 /src/commands/utilities/price.ts
parent6b8115ab1ec94d4330019fc7a93e094d9d64c48e (diff)
downloadtanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.tar.gz
tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.tar.bz2
tanzanite-9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c.zip
fix: breaking changes
Diffstat (limited to 'src/commands/utilities/price.ts')
-rw-r--r--src/commands/utilities/price.ts26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts
index 0117715..e4e4f50 100644
--- a/src/commands/utilities/price.ts
+++ b/src/commands/utilities/price.ts
@@ -86,18 +86,18 @@ export default class PriceCommand extends BushCommand {
// if its a bazaar item then it there should not be any ah data
if (bazaar?.products?.[parsedItem]) {
- priceEmbed
- .setTitle(`Bazaar Information for ${util.format.input(parsedItem)}`)
- .addFields({ name: 'Sell Price', value: addBazaarInformation('sellPrice', 2, true) })
- .addFields({ name: 'Buy Price', value: addBazaarInformation('buyPrice', 2, true) })
- .addFields({
+ priceEmbed.setTitle(`Bazaar Information for ${util.format.input(parsedItem)}`).addFields([
+ { name: 'Sell Price', value: addBazaarInformation('sellPrice', 2, true) },
+ { name: 'Buy Price', value: addBazaarInformation('buyPrice', 2, true) },
+ {
name: 'Margin',
value: (
Number(addBazaarInformation('buyPrice', 2, false)) - Number(addBazaarInformation('sellPrice', 2, false))
).toLocaleString()
- })
- .addFields({ name: 'Current Sell Orders', value: addBazaarInformation('sellOrders', 0, true) })
- .addFields({ name: 'Current Buy Orders', value: addBazaarInformation('buyOrders', 0, true) });
+ },
+ { name: 'Current Sell Orders', value: addBazaarInformation('sellOrders', 0, true) },
+ { name: 'Current Buy Orders', value: addBazaarInformation('buyOrders', 0, true) }
+ ]);
return await message.util.reply({ embeds: [priceEmbed] });
}
@@ -140,10 +140,12 @@ export default class PriceCommand extends BushCommand {
}
function addPrice(name: string, price: number | undefined) {
if (price)
- priceEmbed.addFields({
- name: name,
- value: price.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })
- });
+ priceEmbed.addFields([
+ {
+ name: name,
+ value: price.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })
+ }
+ ]);
}
}