diff options
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts index 9de531f..4da37d7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import { createSession, fetchAccountFromDiscord, fetchAllLeaderboardsCategorized, fetchLeaderboard, fetchMemberLeaderboardSpots, fetchSession, finishedCachingRawLeaderboards, leaderboardUpdateMemberQueue, leaderboardUpdateProfileQueue, updateAccount, deleteSession, fetchPaginatedItemsAuctions, fetchItemsAuctions } from './database.js' -import { fetchAuctionItems, fetchAuctionUncached, fetchElection, fetchItemList, fetchMemberProfile, fetchUser } from './hypixel.js' +import { fetchAuctionItems, fetchAuctionUncached, fetchElection, fetchItemList, fetchMemberProfile, fetchPlayerAuctions, fetchUser } from './hypixel.js' import rateLimit from 'express-rate-limit' import * as constants from './constants.js' import * as discord from './discord.js' @@ -206,6 +206,20 @@ app.get('/auction/:uuid', async (req, res) => { } }) + + +app.get('/playerauctions/:user', async (req, res) => { + try { + res.json( + await fetchPlayerAuctions(req.params.user) + ) + } catch (err) { + console.error(err) + res.json({ ok: false }) + } +}) + + app.post('/accounts/createsession', async (req, res) => { try { const { code } = req.body |