aboutsummaryrefslogtreecommitdiff
path: root/src/commands/utilities/price.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-26 20:07:19 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-26 20:07:19 -0400
commited59b7f1827ab93573b079144c3eeaa01ce40492 (patch)
tree7ceac6d61a8a25586ab9bbaf7acfbade91c97132 /src/commands/utilities/price.ts
parentc0a81b014a56e4d44c826f78391a930361aab122 (diff)
downloadtanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.gz
tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.bz2
tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.zip
clean up, bug fixes
Diffstat (limited to 'src/commands/utilities/price.ts')
-rw-r--r--src/commands/utilities/price.ts94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/commands/utilities/price.ts b/src/commands/utilities/price.ts
index 059533b..a232e56 100644
--- a/src/commands/utilities/price.ts
+++ b/src/commands/utilities/price.ts
@@ -3,58 +3,15 @@ import { MessageEmbed } from 'discord.js';
import Fuse from 'fuse.js';
import got from 'got';
-interface Summary {
- amount: number;
- pricePerUnit: number;
- orders: number;
-}
-
-interface Bazaar {
- success: boolean;
- lastUpdated: number;
- products: {
- [key: string]: {
- product_id: string;
- sell_summary: Summary[];
- buy_summary: Summary[];
- quick_status: {
- productId: string;
- sellPrice: number;
- sellVolume: number;
- sellMovingWeek: number;
- sellOrders: number;
- buyPrice: number;
- buyVolume: number;
- buyMovingWeek: number;
- buyOrders: number;
- };
- };
- };
-}
-
-interface LowestBIN {
- [key: string]: number;
-}
-
-interface AuctionAverages {
- [key: string]: {
- price?: number;
- count?: number;
- sales?: number;
- clean_price?: number;
- clean_sales?: number;
- };
-}
-
export default class PriceCommand extends BushCommand {
public constructor() {
super('price', {
aliases: ['price'],
category: 'utilities',
description: {
- usage: 'price <item id>',
- examples: ['price ASPECT_OF_THE_END'],
- content: 'Finds the price information of an item.'
+ content: 'Finds the price information of an item.',
+ usage: ['price <item id>'],
+ examples: ['price ASPECT_OF_THE_END']
},
args: [
{
@@ -94,7 +51,7 @@ export default class PriceCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage, { item, strict }: { item: string; strict: boolean }): Promise<unknown> {
+ public override async exec(message: BushMessage, { item, strict }: { item: string; strict: boolean }) {
if (message.util.isSlashMessage(message)) await message.interaction.deferReply();
const errors = new Array<string>();
@@ -189,3 +146,46 @@ export default class PriceCommand extends BushCommand {
}
}
}
+
+interface Summary {
+ amount: number;
+ pricePerUnit: number;
+ orders: number;
+}
+
+interface Bazaar {
+ success: boolean;
+ lastUpdated: number;
+ products: {
+ [key: string]: {
+ product_id: string;
+ sell_summary: Summary[];
+ buy_summary: Summary[];
+ quick_status: {
+ productId: string;
+ sellPrice: number;
+ sellVolume: number;
+ sellMovingWeek: number;
+ sellOrders: number;
+ buyPrice: number;
+ buyVolume: number;
+ buyMovingWeek: number;
+ buyOrders: number;
+ };
+ };
+ };
+}
+
+interface LowestBIN {
+ [key: string]: number;
+}
+
+interface AuctionAverages {
+ [key: string]: {
+ price?: number;
+ count?: number;
+ sales?: number;
+ clean_price?: number;
+ clean_sales?: number;
+ };
+}