ClashManager class
A clash manager - to fetch and store clash tournaments and related data. Requires API key with access to clash-v1
API.
Signature:
export declare class ClashManager implements BaseManager<Tournament>
Implements: BaseManager<Tournament>
References: BaseManager, Tournament
Constructor
new ClashManager (client: Client)
Constructs a new instance of the ClashManager
class.
Parameters:
Parameter | Type | Description |
---|---|---|
client | Client | The client this clash manager belongs to. |
Properties
client
The client this clash manager belongs to.
Type: Client
Methods
.fetch ()
Fetch a clash tournament by its ID.
Signature:
fetch(id: number, options?: FetchOptions): Promise<Tournament>;
Parameters:
Parameter | Type | Description |
---|---|---|
id | Number | The ID of the clash tournament. |
options | FetchOptions | The basic fetch options. |
Return type: Promise < Tournament >
.fetchAll ()
Fetch all upcoming and active clash tournaments.
Signature:
fetchAll(options?: FetchOptions): Promise<Tournament[]>;
Parameters:
Parameter | Type | Description |
---|---|---|
options | FetchOptions | The basic fetch options (always fetches from the API, skipping cache and storage). |
Return type: Promise < Tournament >
.fetchByTeamId ()
Fetch a clash tournament by participating team's ID.
Signature:
fetchByTeamId(teamId: string, options?: FetchOptions): Promise<Tournament>;
Parameters:
Parameter | Type | Description |
---|---|---|
teamId | String | The ID of the team. |
options | FetchOptions | The basic fetch options (always fetches from API, skipping cache and storage). |
Return type: Promise < Tournament >
.fetchPlayer ()
Fetch participation info of a summoner in clash tournaments by the summoner ID.
Signature:
fetchPlayer(summonerId: string, options?: FetchOptions): Promise<TournamentPlayer[]>;
Parameters:
Parameter | Type | Description |
---|---|---|
summonerId | String | The ID of the summoner. |
options | FetchOptions | The basic fetch options. |
Return type: Promise < TournamentPlayer >
.fetchTeam ()
Fetch a team participating in a clash tournament by the team ID.
Signature:
fetchTeam(teamId: string, options?: FetchOptions): Promise<TournamentTeam>;
Parameters:
Parameter | Type | Description |
---|---|---|
teamId | String | The ID of the team. |
options | FetchOptions | The basic fetch options. |
Return type: Promise < TournamentTeam >