ChallengeManager class


A challenge manager - to fetch and manage all the challenges' data. Requires API key with access to lol-challenges-v1 API.

Signature:

export declare class ChallengeManager implements BaseManager<Challenge> 

Implements: BaseManager<Challenge>

References: BaseManager, Challenge


Constructor

new ChallengeManager (client: Client)

Constructs a new instance of the ChallengeManager class.

Parameters:

ParameterTypeDescription
clientClientThe client this challenge manager belongs to.

Properties

client

The client this challenge manager belongs to.

Type: Client


Methods

.fetch ()

Fetch a challenge by the challenge ID.

Signature:

fetch(id: number, options?: FetchOptions): Promise<Challenge>;

Parameters:

ParameterTypeDescription
idNumberThe ID of the challenge you want to find.
optionsFetchOptionsThe basic fetching options.

Return type: Promise < Challenge >


.fetchAll ()

Fetch all challenges.

Signature:

fetchAll(options?: FetchOptions): Promise<Collection<number, Challenge>>;

Parameters:

ParameterTypeDescription
optionsFetchOptionsThe basic fetching options (force is ignored here).

Return type: Promise < Collection < Number, Challenge > >


.fetchLeaderboard ()

Fetch the leader board of a challenge.

Signature:

fetchLeaderboard(id: number, level: 'MASTER' | 'GRANDMASTER' | 'CHALLENGER', options?: FetchOptions & {        limit: number;    }): Promise<ChallengeRank[]>;

Parameters:

ParameterTypeDescription
idNumberThe ID of the challenge whose leaderboard you want to find.
level'MASTER' | 'GRANDMASTER' | 'CHALLENGER'The tier of the leaderboard.
optionsFetchOptions & { limit: number; }The basic fetching options, with an additional limit option. Limit (or count) is 200 by default.

Return type: Promise < ChallengeRank >


.fetchSummonerProgression ()

Fetch the progress of a summoner in the challenges.

Signature:

fetchSummonerProgression(playerId: string, options?: FetchOptions): Promise<SummonerChallenge>;

Parameters:

ParameterTypeDescription
playerIdStringThe player ID (puuid) of the summoner whose progress you want to find.
optionsFetchOptionsThe basic fetching options.

Return type: Promise < SummonerChallenge >