Clans

Clan profiles, clan members, clan labels, and clan search models.

Clan

struct clashy.Clan

Clan is the full clan profile returned by GetClan and search endpoints.

Tag

string json: tag

Tag is the clan tag.

Name

string json: name

Name is the clan display name.

Type

ClanType json: type

Type describes whether the clan is open, closed, or invite-only.

Description

string json: description

Description is the public clan description.

FamilyFriendly

bool json: isFamilyFriendly

FamilyFriendly reports whether the clan is marked family friendly.

Level

int json: clanLevel

Level is the clan level.

Points

int json: clanPoints

Points is the clan's home village trophy score.

BuilderBasePoints

int json: clanBuilderBasePoints

BuilderBasePoints is the clan's Builder Base trophy score.

CapitalPoints

int json: clanCapitalPoints

CapitalPoints is the clan's Clan Capital score.

RequiredTrophies

int json: requiredTrophies

RequiredTrophies is the home village trophy requirement to join.

WarFrequency

string json: warFrequency

WarFrequency is the clan's declared war frequency.

WarWinStreak

int json: warWinStreak

WarWinStreak is the current classic-war win streak.

WarWins

int json: warWins

WarWins is the number of classic-war wins.

WarTies

int json: warTies

WarTies is the number of classic-war ties when the API includes it.

WarLosses

int json: warLosses

WarLosses is the number of classic-war losses when the API includes it.

PublicWarLog

bool json: isWarLogPublic

PublicWarLog reports whether the clan war log is public.

MemberCount

int json: members

MemberCount is the number of current clan members.

RequiredBuilderBaseTrophies

int json: requiredBuilderBaseTrophies

RequiredBuilderBaseTrophies is the Builder Base trophy requirement to join.

RequiredTownhall

int json: requiredTownhallLevel

RequiredTownhall is the minimum Town Hall level required to join.

Location

*Location json: location

Location is the clan's declared location.

Badge

Badge json: badgeUrls

Badge contains the clan badge image URLs.

Labels

[]Label json: labels

Labels are public labels assigned to the clan.

Members

[]ClanMember json: memberList

Members is the member list embedded in full clan responses.

WarLeague

League json: warLeague

WarLeague is the clan's current Clan War League tier.

CapitalLeague

*League json: capitalLeague

CapitalLeague is the clan's Clan Capital league.

ChatLanguage

*ChatLanguage json: chatLanguage

ChatLanguage is the clan's preferred chat language.

ClanCapital

*ClanCapital json: clanCapital

ClanCapital contains Clan Capital district information.

Clan Member

struct clashy.ClanMember

ClanMember describes a member entry from a clan profile or member list.

Tag

string json: tag

Tag is the member's player tag.

Name

string json: name

Name is the member's player name.

Role

Role json: role

Role is the member's clan role.

ExpLevel

int json: expLevel

ExpLevel is the player's experience level.

TownHall

int json: townHallLevel

TownHall is the player's home village Town Hall level.

Trophies

int json: trophies

Trophies is the player's home village trophy count.

ClanRank

int json: clanRank

ClanRank is the player's current position in the clan trophy ranking.

ClanPreviousRank

int json: previousClanRank

ClanPreviousRank is the player's previous position in the clan trophy ranking.

Donations

int json: donations

Donations is the number of troops donated this season.

Received

int json: donationsReceived

Received is the number of donated troops received this season.

VersusTrophies

int json: versusTrophies

VersusTrophies is the legacy Builder Base trophy field used by older API responses.

BuilderBaseTrophies

int json: builderBaseTrophies

BuilderBaseTrophies is the player's Builder Base trophy count.

VersusRank

int json: versusRank

VersusRank is the legacy Builder Base rank field used by older API responses.

BuilderBaseRank

int json: builderBaseRank

BuilderBaseRank is the player's current Builder Base rank in the clan.

LeagueTier

League json: leagueTier

LeagueTier is the player's home village league.

Player Clan

struct clashy.PlayerClan

PlayerClan is the compact clan object embedded in player responses.

Tag

string json: tag

Tag is the clan tag, including the leading # when returned by the API.

Name

string json: name

Name is the clan display name.

Level

int json: clanLevel

Level is the clan level.

Badge

Badge json: badgeUrls

Badge contains the clan badge image URLs.

Clan Capital

struct clashy.ClanCapital

ClanCapital describes a clan's capital districts from the clan profile.

Districts

[]CapitalDistrict json: districts

Districts contains the visible Clan Capital districts and their hall levels.

Clan Type

type clashy.ClanType

ClanType describes a clan's join policy.

string

Values

ClanTypeOpen

"open"

ClanTypeOpen means players can join directly when requirements are met.

ClanTypeClosed

"closed"

ClanTypeClosed means the clan is closed to new members.

ClanTypeInviteOnly

"inviteOnly"

ClanTypeInviteOnly means players must request or be invited to join.

Clan Methods

clashy.Clan.GetMember(tag: string) -> *ClanMember

GetMember returns the member with the provided tag, or nil when the clan member list does not contain that tag.

Parameters:

tag (string)

Return type:
*ClanMember

clashy.Clan.GetMemberBy(name: string, trophies: int) -> *ClanMember

GetMemberBy returns the first member matching the provided name and trophy filters.

Empty name and zero trophies are treated as wildcards, which is useful when a caller only has one of the two values from an external event.

Parameters:

name (string)

trophies (int)

Return type:
*ClanMember