aboutsummaryrefslogtreecommitdiff
path: root/src/tasks/updatePriceItemCache.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-07-07 20:09:25 +0200
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-07-07 20:09:25 +0200
commit4f32de01e073820e4549618b5727a662a90bc7bf (patch)
treef8ff3faa4d88d3f48f6d6325dfe37098ff694d04 /src/tasks/updatePriceItemCache.ts
parent8d5e4753adeccab790f48dae173783f52f1b9daa (diff)
downloadtanzanite-4f32de01e073820e4549618b5727a662a90bc7bf.tar.gz
tanzanite-4f32de01e073820e4549618b5727a662a90bc7bf.tar.bz2
tanzanite-4f32de01e073820e4549618b5727a662a90bc7bf.zip
minor changes to the price command
Diffstat (limited to 'src/tasks/updatePriceItemCache.ts')
-rw-r--r--src/tasks/updatePriceItemCache.ts10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/tasks/updatePriceItemCache.ts b/src/tasks/updatePriceItemCache.ts
index e6d2db4..5f68a8c 100644
--- a/src/tasks/updatePriceItemCache.ts
+++ b/src/tasks/updatePriceItemCache.ts
@@ -11,13 +11,9 @@ export default class UpdatePriceItemCache extends BushTask {
}
public async exec() {
- //prettier-ignore
- const [bazaar, currentLowestBIN, averageLowestBIN, auctionAverages] = (await Promise.all([
- got.get('https://api.hypixel.net/skyblock/bazaar').json().catch(() => {}),
- got.get('https://moulberry.codes/lowestbin.json').json().catch(() => {}),
- got.get('https://moulberry.codes/auction_averages_lbin/3day.json').json().catch(() => {}),
- got.get('https://moulberry.codes/auction_averages/3day.json').json().catch(() => {})
- ])) as [Bazaar, LowestBIN, LowestBIN, AuctionAverages];
+ const [bazaar, currentLowestBIN, averageLowestBIN, auctionAverages] = (await Promise.all(
+ PriceCommand.urls.map(({ url }) => got.get(url).json().catch(undefined))
+ )) as [Bazaar?, LowestBIN?, LowestBIN?, AuctionAverages?];
const itemNames = new Set([
...Object.keys(averageLowestBIN ?? {}),