LeagueManager class


A league manager - to fetch and manage all summoner competitive info. Requires API key with access to league-v4 and league-exp-v4 API.

Signature:

export declare class LeagueManager implements BaseManager<Collection<QueueType, LeagueEntry>> 

Implements: BaseManager<Collection<QueueType, LeagueEntry>>

References: BaseManager, Collection, QueueType, LeagueEntry


Constructor

new LeagueManager (client: Client)

Constructs a new instance of the LeagueManager class.

Parameters:

ParameterTypeDescription
clientClientThe client this league manager belongs to.

Properties

client

The client this league manager belongs to.

Type: Client


Methods

.fetch ()

Fetch a summoner's competitive info by the summoner's ID.

Signature:

fetch(id: string, options?: FetchOptions): Promise<Collection<QueueType, LeagueEntry>>;

Parameters:

ParameterTypeDescription
idStringThe ID of the summoner whose competitive info you want to find.
optionsFetchOptionsThe basic fetching options.

Return type: Promise < Collection < QueueType, LeagueEntry > >


.fetchByLeagueId ()

Fetch the league entries by a league ID.

Signature:

fetchByLeagueId(leagueId: string, options?: FetchOptions): Promise<LeagueList>;

Parameters:

ParameterTypeDescription
leagueIdStringThe League ID.
optionsFetchOptionsThe basic fetching options (exception: force defaults to true).

Return type: Promise < LeagueList >


.fetchByQueueAndTier ()

Fetch a collection of league entries by the queue type, tier and division.

Signature:

fetchByQueueAndTier(queue: QueueType, tier: TierType, division: DivisionType, options?: FetchOptions & {        page: number;    }): Promise<Collection<string, LeagueEntry>>;

Parameters:

ParameterTypeDescription
queueQueueTypeThe type of queue - RANKED_SOLO_5x5, RANKED_FLEX_SR, etc.
tierTierTypeThe tier of the entries - IRON to CHALLENGER.
divisionDivisionTypeThe division of the entries - I, II, III, IV.
optionsFetchOptions & { page: number; }The basic fetching options (and page number - defaults to 1).

Return type: Promise < Collection < String, LeagueEntry > >