Class: Player
Represents a Clash of Clans Player.
Constructors
constructor
• new Player(client
, data
)
Parameters
Name | Type |
---|---|
client | Client |
data | APIPlayer |
Defined in
Properties
name
• name: string
The player's name.
Defined in
tag
• tag: string
The player's tag.
Defined in
townHallLevel
• townHallLevel: number
The player's Town Hall level..
Defined in
townHallWeaponLevel
• townHallWeaponLevel: null
| number
The player's Town Hall weapon level.
Defined in
expLevel
• expLevel: number
The player's experience level.
Defined in
trophies
• trophies: number
The player's trophy count.
Defined in
bestTrophies
• bestTrophies: number
The player's best trophies.
Defined in
warStars
• warStars: number
The player's war stars.
Defined in
attackWins
• attackWins: number
The number of attacks the player has won this season.
Defined in
defenseWins
• defenseWins: number
The number of defenses the player has won this season.
Defined in
builderHallLevel
• builderHallLevel: null
| number
The player's builder hall level, or 0 if it hasn't been unlocked.
Defined in
builderBaseTrophies
• builderBaseTrophies: null
| number
The player's builder base trophy count.
Defined in
bestBuilderBaseTrophies
• bestBuilderBaseTrophies: null
| number
The player's best builder base trophies.
Defined in
donations
• donations: number
The player's donation count for this season.
Defined in
received
• received: number
The player's donation received count for this season.
Defined in
clanCapitalContributions
• clanCapitalContributions: number
The player's total Clan Capital contribution
Defined in
role
• role: null
| "member"
| "coLeader"
| "leader"
| "elder"
The player's role in the clan or null
if not in a clan.
Defined in
warOptedIn
• warOptedIn: null
| boolean
Whether the player has selected that they are opted in. This will be null
if the player is not in a clan.
Defined in
clan
• clan: null
| PlayerClan
The player's clan.
Defined in
league
• league: League
The player's current League.
Defined in
legendStatistics
• legendStatistics: null
| LegendStatistics
The player's legend statistics, or null
if they have never been in the legend league.
Defined in
achievements
• achievements: Achievement
[]
An array of the player's achievements.
Defined in
labels
• labels: Label
[]
An array of player's labels.
Defined in
troops
• troops: Troop
[]
An array of player's troops (including pets and seige machines).
Defined in
spells
• spells: Spell
[]
An array of player's spells.
Defined in
heroes
• heroes: Hero
[]
An array of player's heroes (both home base and build base).
Defined in
heroEquipment
• heroEquipment: HeroEquipment
[]
An array of player's hero equipment.
Defined in
playerHouse
• Optional
playerHouse: null
| APIPlayerHouse
The player's clan capital house details.
Defined in
Accessors
inClan
• get
inClan(): boolean
Whether this clan member is in the clan.
Returns
boolean
Defined in
isMember
• get
isMember(): null
| boolean
Whether this clan member is in the clan.
Returns
null
| boolean
Defined in
isLeader
• get
isLeader(): null
| boolean
Whether this clan member is a Leader.
Returns
null
| boolean
Defined in
isCoLeader
• get
isCoLeader(): null
| boolean
Whether this clan member is a Co-Leader.
Returns
null
| boolean
Defined in
isElder
• get
isElder(): null
| boolean
Whether this clan member is an Elder.
Returns
null
| boolean
Defined in
homeTroops
• get
homeTroops(): Troop
[]
An array of the player's home base troops.
Returns
Troop
[]
Defined in
builderTroops
• get
builderTroops(): Troop
[]
An array of the player's builder base troops.
Returns
Troop
[]
Defined in
superTroops
• get
superTroops(): Troop
[]
An array of the player's super troops.
Returns
Troop
[]
Defined in
heroPets
• get
heroPets(): Troop
[]
An array of the player's hero pets.
Returns
Troop
[]
Defined in
siegeMachines
• get
siegeMachines(): Troop
[]
An array of the player's siege machines.
Returns
Troop
[]
Defined in
shareLink
• get
shareLink(): string
Get player's formatted link to open player in-game.
Returns
string
Defined in
Methods
fetchClan
▸ fetchClan(options?
): Promise
<null
| Clan
>
Fetch detailed clan info for the player's clan.
Parameters
Name | Type |
---|---|
options? | OverrideOptions |
Returns
Promise
<null
| Clan
>