EventClient

class EventClient(email: String, password: String, clientConfiguration: ClientConfiguration.() -> Unit = {}) : Client

Client for managing and monitoring events related to players and clans.

This class allows you to register callbacks for specific events and periodically update player data to detect changes. It uses a coroutine-based approach for asynchronous event handling.

Parameters

email

The email associated with the Clash of Clans API account.

password

The password associated with the Clash of Clans API account.

clientConfiguration

The configuration for the client.You can customize the client using the ClientConfiguration DSL.

Constructors

Link copied to clipboard
constructor(email: String, password: String, clientConfiguration: ClientConfiguration.() -> Unit = {})

Functions

Link copied to clipboard

Adds a clan's tag to the update queue for monitoring. Once a clan's tag is added to the queue, the client will begin monitoring the clan.

Link copied to clipboard

Adds a player's tag to the update queue for monitoring. Once a player's tag is added to the queue, the client will begin monitoring the player.

Link copied to clipboard

Adds a clan's war events to the update queue for monitoring. Once a clan's war events are added to the queue, the client will start monitoring them.

Link copied to clipboard
suspend fun getBuilderBaseLeague(leagueId: Int, pagination: PaginationQuery = PaginationQuery()): Deferred<SimpleLeague>

Retrieves information about a specific Builder Base league based on the provided leagueId.

Link copied to clipboard
suspend fun getBuilderBaseLeagues(pagination: PaginationQuery = PaginationQuery()): Deferred<SimpleLeagueList>

Retrieves the list of Builder Base leagues.

Link copied to clipboard
suspend fun getCapitalLeague(leagueId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<SimpleLeague>

Retrieves detailed information about a specific capital league based on the provided leagueId.

Link copied to clipboard
suspend fun getCapitalLeagues(pagination: PaginationQuery = PaginationQuery()): Deferred<SimpleLeagueList>

Retrieves a list of capital leagues.

Link copied to clipboard
suspend fun getClan(clanTag: String): Deferred<Clan>

Retrieves detailed information about a clan based on the provided clanTag.

Link copied to clipboard
suspend fun getClanCapitalRaidSeasons(clanTag: String, pagination: PaginationQuery = PaginationQuery()): Deferred<ClanCapitalRaidSeasons>

Retrieves the capital raid seasons of a clan based on the provided clanTag.

Link copied to clipboard
suspend fun getClanCurrentWar(clanTag: String): Deferred<ClanWar>

Retrieves the current war of a clan based on the provided clanTag.

Link copied to clipboard
suspend fun getClanLabels(pagination: PaginationQuery = PaginationQuery()): Deferred<LabelList>

Retrieves a list of clan labels.

Link copied to clipboard
suspend fun getClanMembers(clanTag: String, pagination: PaginationQuery = PaginationQuery()): Deferred<ClanMemberList>

Retrieves the list of members in a clan based on the provided clanTag.

Link copied to clipboard
suspend fun getClanWarLeagueGroup(clanTag: String): Deferred<ClanWarLeagueGroup>

Gets the Clan War League group for the clan specified by clanTag.

Link copied to clipboard
suspend fun getClanWarLeagueWar(warTag: String): Deferred<ClanWar>

Gets the Clan War League war specified by warTag.

Link copied to clipboard
suspend fun getClanWarLog(clanTag: String, pagination: PaginationQuery = PaginationQuery()): Deferred<ClanWarLog>

Retrieves the war log of a clan based on the provided clanTag.

Link copied to clipboard
suspend fun getCurrentGoldPass(): Deferred<GoldPassSeason>

Retrieves the current Gold Pass season information.

Link copied to clipboard
suspend fun getLeague(leagueId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<League>

Retrieves detailed information about a specific league based on the provided leagueId.

Link copied to clipboard
suspend fun getLeagues(pagination: PaginationQuery = PaginationQuery()): Deferred<LeagueList>

Retrieves a list of leagues.

Link copied to clipboard
suspend fun getLeagueSeasonRanking(leagueId: String, seasonId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<PlayerRankingList>

Retrieves the ranking of players for a specific league season based on the provided leagueId and seasonId.

Link copied to clipboard
suspend fun getLeagueSeasons(leagueId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<LeagueSeasonList>

Retrieves a list of seasons for a specific league based on the provided leagueId.

Link copied to clipboard
suspend fun getLocation(locationId: String): Deferred<Location>

Retrieves information about a specific location based on the provided locationId.

Link copied to clipboard
suspend fun getLocationCapitalRanking(locationId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<ClanCapitalRankingList>

Retrieves the list of clans ranked in the Capital for a specific location based on the provided locationId.

Link copied to clipboard
suspend fun getLocationClanBuilderBaseRanking(locationId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<ClanBuilderBaseRankingList>

Retrieves the list of clans ranked in the Builder Base for a specific location based on the provided locationId.

Link copied to clipboard
suspend fun getLocationClanRanking(locationId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<ClanRankingList>

Retrieves the list of clans ranked in a specific location based on the provided locationId.

Link copied to clipboard
suspend fun getLocationPlayerBuilderBaseRanking(locationId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<PlayerBuilderBaseRankingList>

Retrieves the list of players ranked in the Builder Base for a specific location based on the provided locationId.

Link copied to clipboard
suspend fun getLocationPlayerRanking(locationId: String, pagination: PaginationQuery = PaginationQuery()): Deferred<PlayerRankingList>

Retrieves the list of players ranked in a specific location based on the provided locationId.

Link copied to clipboard
suspend fun getLocations(pagination: PaginationQuery = PaginationQuery()): Deferred<LocationList>

Retrieves the list of available locations.

Link copied to clipboard
suspend fun getPlayer(playerTag: String): Deferred<Player>

Retrieves detailed information about a player based on the provided playerTag.

Link copied to clipboard
suspend fun getPlayerLabels(pagination: PaginationQuery = PaginationQuery()): Deferred<LabelList>

Retrieves a list of player labels.

Link copied to clipboard
suspend fun getWarLeague(leagueId: Int, pagination: PaginationQuery = PaginationQuery()): Deferred<SimpleLeague>

Retrieves information about a specific War League based on the provided leagueId.

Link copied to clipboard
suspend fun getWarLeagues(pagination: PaginationQuery = PaginationQuery()): Deferred<SimpleLeagueList>

Retrieves the list of War Leagues.

Link copied to clipboard
suspend fun login()

Performs login into the Clash of Clans developer website using the provided credentials.

Link copied to clipboard
fun registerClanCallback(event: ClanEvents, callback: suspend (Clan, Clan) -> Unit)

Registers a callback for clan-related events.

fun registerClanCallback(event: ClanEvents, callback: suspend (Clan, Clan, ClanMember) -> Unit)

Registers a callback for clan-related events with an iterable callback function.

Link copied to clipboard

Registers a callback for maintenance-related events.

Registers a callback for maintenance-related events with an iterable callback function.

Link copied to clipboard
fun registerPlayerCallback(event: PlayerEvents, callback: suspend (Player, Player) -> Unit)

Registers a callback for player-related events.

fun registerPlayerCallback(event: PlayerEvents, callback: suspend (Player, Player, String) -> Unit)

Registers a callback for player-related events with an iterable callback function.

Link copied to clipboard
fun registerWarCallback(event: WarEvents, callback: suspend (ClanWar) -> Unit)

Registers a callback for war-related events.

fun registerWarCallback(event: WarEvents, callback: suspend (ClanWar, ClanWarAttack) -> Unit)

Registers a callback for war-related events with an iterable callback function.

Link copied to clipboard

Removes a clan's tag from the update queue. Once a clan's tag is removed from the queue, the client stops monitoring the clan.

Link copied to clipboard

Removes a player's tag from the update queue. Once a player's tag is removed from the queue, the client stops monitoring the player.

Link copied to clipboard

Removes a clan's war events from the update queue. Once a clan's war events are removed from the queue, the client stops monitoring them.

Link copied to clipboard
suspend fun searchClan(searchClanQuery: SearchClanQuery): Deferred<ClanList>

Searches for clans based on the provided searchClanQuery.

Link copied to clipboard

Starts polling for events and updating player data.