diff options
author | mat <github@matdoes.dev> | 2022-07-01 14:53:02 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-07-01 14:53:02 -0500 |
commit | 4b32a88289083fb4b2b78ca949c1555a404a3390 (patch) | |
tree | 002e8cdff4c9a420615e0d6e4c5064b9e61367c6 /src/hypixel.ts | |
parent | 791be0dd5680181df030c8d9914484ccfa47db71 (diff) | |
download | skyblock-api-4b32a88289083fb4b2b78ca949c1555a404a3390.tar.gz skyblock-api-4b32a88289083fb4b2b78ca949c1555a404a3390.tar.bz2 skyblock-api-4b32a88289083fb4b2b78ca949c1555a404a3390.zip |
playerauctions endpoint
Diffstat (limited to 'src/hypixel.ts')
-rw-r--r-- | src/hypixel.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/hypixel.ts b/src/hypixel.ts index ba0b83c..944206d 100644 --- a/src/hypixel.ts +++ b/src/hypixel.ts @@ -33,7 +33,7 @@ import * as cached from './hypixelCached.js' import { debug } from './index.js' import { WithId } from 'mongodb' import { cleanEndedAuctions } from './cleaners/skyblock/endedAuctions.js' -import { cleanAuctions } from './cleaners/skyblock/auctions.js' +import { Auction, cleanAuctions } from './cleaners/skyblock/auctions.js' import { string } from 'prismarine-nbt' import { withCache } from './util.js' import { Item } from './cleaners/skyblock/inventory.js' @@ -485,3 +485,15 @@ async function fetchAuctionItemsUncached() { return idsToData } +export async function fetchPlayerAuctions(user: string): Promise<Auction[] | null> { + const playerUuid = await cached.uuidFromUser(user) + if (!playerUuid) return null + + const playerAuctions = await sendCleanApiRequest( + 'skyblock/auction', + { + player: playerUuid + } + ) + return playerAuctions +} |