@zikeji/hypixel
Version:
With IntelliSense support & test coverage, this is an unopinionated async/await API wrapper for Hypixel's Public API. It is developed in TypeScript complete with documentation, typed interfaces for all API responses, built-in rate-limit handling, flexible
34 lines (32 loc) • 1.01 kB
text/typescript
import { Paths } from "../types/api";
import { Method } from "../util/Method";
import { getResultArray, ResultArray } from "../util/ResultArray";
import type { RecentGamesResponse } from "../types/AugmentedTypes";
/**
* @example
* ```typescript
* const recent = await client.recentgames.uuid("20934ef9488c465180a78f861586b4cf");
* ```
* @category Client
*/
export class Recentgames extends Method {
/**
* Returns recent games of a player. A maximum of 100 games are returned and recent games are only stored for up to 3 days at this time.
* @example
* ```typescript
* const response = await client.recentgames.uuid("20934ef9488c465180a78f861586b4cf");
* console.log(response);
* ```
* @category API
*/
public async uuid(
uuid: Paths.V2Recentgames.Get.Parameters.Uuid
): Promise<ResultArray<RecentGamesResponse, "games">> {
return getResultArray(
await this.client.call<RecentGamesResponse>("recentgames", {
uuid,
}),
"games"
);
}
}