Documentation
¶
Overview ¶
Package goroyale is a wrapper for the Clash Royale API at https://royaleapi.com/
Index ¶
- type APIError
- type APIKeyStats
- type Achievement
- type Arena
- type Badge
- type Battle
- type BattleMode
- type Card
- type Clan
- type ClanChest
- type ClanHistoryEntry
- type ClanHistoryMember
- type ClanMember
- type ClanSearch
- type ClanTracking
- type ClanWar
- type ClanWarClan
- type ClanWarLogClan
- type ClanWarLogEntry
- type ClanWarParticipant
- type Client
- func (c *Client) APIKeyStats(params url.Values) (keyStats APIKeyStats, err error)
- func (c *Client) APIVersion() (ver string, err error)
- func (c *Client) Clan(tag string, params url.Values) (clan Clan, err error)
- func (c *Client) ClanBattles(tag string, params url.Values) (battles []Battle, err error)
- func (c *Client) ClanHistory(tag string, params url.Values) (history []ClanHistoryEntry, err error)
- func (c *Client) ClanSearch(params url.Values) (clans []ClanSearch, err error)
- func (c *Client) ClanTracking(tag string, params url.Values) (tracking ClanTracking, err error)
- func (c *Client) ClanWar(tag string, params url.Values) (war ClanWar, err error)
- func (c *Client) ClanWarLog(tag string, params url.Values) (warlog []ClanWarLogEntry, err error)
- func (c *Client) ClanWeeklyHistory(tag string, params url.Values) (history []ClanHistoryEntry, err error)
- func (c *Client) Clans(tags []string, params url.Values) (clans []Clan, err error)
- func (c *Client) Constants(params url.Values) (constants Constants, err error)
- func (c *Client) Endpoints(params url.Values) (endpoints []string, err error)
- func (c *Client) Get1kTournaments(params url.Values) (tournaments []Tournament1k, err error)
- func (c *Client) KnownTournaments(params url.Values) (tournaments []Tournament, err error)
- func (c *Client) OpenTournaments(params url.Values) (tournaments []Tournament, err error)
- func (c *Client) Player(tag string, params url.Values) (player Player, err error)
- func (c *Client) PlayerBattles(tag string, params url.Values) (battles []Battle, err error)
- func (c *Client) PlayerChests(tag string, params url.Values) (chests PlayerChests, err error)
- func (c *Client) Players(tags []string, params url.Values) (players []Player, err error)
- func (c *Client) PlayersBattles(tags []string, params url.Values) (battles [][]Battle, err error)
- func (c *Client) PlayersChests(tags []string, params url.Values) (chests []PlayerChests, err error)
- func (c *Client) PopularClans(params url.Values) (popularClans []PopularClan, err error)
- func (c *Client) PopularDecks(params url.Values) (popularDecks []PopularDeck, err error)
- func (c *Client) PopularPlayers(params url.Values) (popularPlayers []PopularPlayer, err error)
- func (c *Client) PopularTournaments(params url.Values) (popularTournaments []PopularTournament, err error)
- func (c *Client) PrepTournaments(params url.Values) (tournaments []PrepTournament, err error)
- func (c *Client) TopClans(location string, params url.Values) (topClans []TopClan, err error)
- func (c *Client) TopPlayers(location string, params url.Values) (topPlayers []TopPlayer, err error)
- func (c *Client) Tournament(tag string, params url.Values) (tournament SpecificTournament, err error)
- func (c *Client) TournamentSearch(params url.Values) (tournaments []SearchedTournament, err error)
- func (c *Client) Tournaments(tags []string, params url.Values) (tournaments []SpecificTournament, err error)
- type Constants
- type FavoriteCard
- type LeagueStatistics
- type Location
- type Player
- type PlayerChests
- type PlayerClan
- type PlayerGames
- type PlayerStats
- type PopularClan
- type PopularDeck
- type PopularDeckCard
- type PopularPlayer
- type PopularTournament
- type Popularity
- type PrepTournament
- type SearchedTournament
- type SpecificTournament
- type TeamClan
- type TeamMember
- type TopClan
- type TopPlayer
- type Tournament
- type Tournament1k
- type TournamentMember
- type Tracking
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶ added in v0.2.0
type APIError struct {
StatusCode int `json:"status"` // http response code
Message string // human readable message explaining the error
}
APIError represents an error returned from the API. https://docs.royaleapi.com/#/errors
type APIKeyStats ¶
APIKeyStats represents info on your API token. https://docs.royaleapi.com/#/endpoints/auth_stats
type Achievement ¶
type Achievement struct {
Name string
Stars int
Value int
Target int // Value you need to reach to complete the achievement
Info string
}
Achievement represents a player's stats and progress on an achievement.
type Arena ¶
type Arena struct {
Name string
Arena string // Arena's level within a league ex: "League 3"
ArenaID int // Arena's number in hierarchy of arenas
TrophyLimit int // Upper boundary of arena trophy range
}
Arena represents a trophy range.
type Battle ¶
type Battle struct {
Type string
ChallengeType string
Mode BattleMode
WinCountBefore int
UTCTime int
DeckType string
TeamSize int
// Winner = TeamCrowns - OpponentCrowns
// 0 => tie
// positive => player won
// negative => opponent won
Winner int
TeamCrowns int
OpponentCrowns int
Team []TeamMember
Opponent []TeamMember
Arena Arena
}
Battle represents a match played.
type BattleMode ¶
type BattleMode struct {
Name string
Deck string
CardLevels string
OvertimeSeconds int
Players string
SameDeck bool
}
BattleMode represents info on the type of battle.
type Card ¶
type Card struct {
Name string
Level int
MaxLevel int
Count int
Rarity string
RequiredForUpgrade requiredForUpgrade
Icon string
Key string
Elixir int
Type string
Arena int
Description string
ID int
}
Card represents a card from the game. RequiredForUpgrade will be -1 if the card is max level.
type Clan ¶
type Clan struct {
Tag string
Name string
Description string
Type string
Score int
MemberCount int
RequiredScore int
Donations int
ClanChest ClanChest
Badge Badge
Location Location
Members []ClanMember
}
Clan represents a clan received directly from the clan endpoint.
type ClanChest ¶
ClanChest is no longer in the game but the API lists it so it is here for completion's sake.
type ClanHistoryEntry ¶
type ClanHistoryEntry struct {
Donations int
MemberCount int
Members []ClanHistoryMember
}
ClanHistoryEntry represents a value of a key in the object returned from the clan history endpoint. https://docs.royaleapi.com/#/endpoints/clan_history
type ClanHistoryMember ¶
type ClanHistoryMember struct {
ClanRank int
Crowns int
Donations int
Name string
Tag string
Trophies int
}
ClanHistoryMember represents a member of a clan within the clan history endpoint.
type ClanMember ¶
type ClanMember struct {
Name string
Tag string
Rank int // Player's ranking within the clan
PreviousRank int
Role string
EXPLevel int
Trophies int
ClanChestCrowns int
Donations int
DonationsReceived int
DonationsDelta int
DonationsPercent float64
Arena Arena
}
ClanMember represents a player inside of a clan received directly from the clan endpoint.
type ClanSearch ¶
type ClanSearch struct {
Tag string
Name string
Type string
Score int
MemberCount int
RequiredScore int
Donations int
Badge Badge
Location Location
}
ClanSearch represents a clan received from the clan search endpoint.
type ClanTracking ¶
ClanTracking represents basic info on whether a clan is tracked by the API. https://docs.royaleapi.com/#/endpoints/clan_tracking
type ClanWar ¶
type ClanWar struct {
State string
WarEndTime int
CollectionEndTime int
Clan ClanWarClan
Participants []ClanWarParticipant
Standings []ClanWarClan
}
ClanWar represents a war a clan participated/is participating in.
type ClanWarClan ¶
type ClanWarClan struct {
Tag string
Name string
Participants int
BattlesPlayed int
Wins int
Crowns int
WarTrophies int
Badge Badge
}
ClanWarClan represents the clan that was queried for when getting a ClanWar.
type ClanWarLogClan ¶
type ClanWarLogClan struct {
ClanWarClan
WarTrophiesChange int
}
ClanWarLogClan represents a clan that participated in a clan war returned from the clan warlog endpoint.
type ClanWarLogEntry ¶
type ClanWarLogEntry struct {
CreatedDate int
Participants []ClanWarParticipant
Standings []ClanWarLogClan
SeasonNumber int
}
ClanWarLogEntry represents a clan war returned from the clan warlog endpoint
type ClanWarParticipant ¶
type ClanWarParticipant struct {
Tag string
Name string
CardsEarned int
BattlesPlayed int
Wins int
}
ClanWarParticipant represents a player who was a member of a clan war.
type Client ¶
type Client struct {
Token string
// contains filtered or unexported fields
}
Client allows you to easily interact with RoyaleAPI.
func (*Client) APIKeyStats ¶ added in v0.3.0
func (c *Client) APIKeyStats(params url.Values) (keyStats APIKeyStats, err error)
APIKeyStats returns information about the currently authenticated token. https://docs.royaleapi.com/#/endpoints/auth_stats
func (*Client) APIVersion ¶ added in v0.3.0
APIVersion requests the current version of the API. https://docs.royaleapi.com/#/endpoints/version
func (*Client) Clan ¶ added in v0.3.0
Clan returns info about a specific clan. https://docs.royaleapi.com/#/endpoints/clan
func (*Client) ClanBattles ¶ added in v0.3.0
ClanBattles returns battles played by people in the specified clan. https://docs.royaleapi.com/#/endpoints/clan_battles
func (*Client) ClanHistory ¶ added in v0.3.0
ClanHistory returns a time series of member stats. This will only work with clans that have enabled stat tracking. https://docs.royaleapi.com/#/endpoints/clan_history
func (*Client) ClanSearch ¶
func (c *Client) ClanSearch(params url.Values) (clans []ClanSearch, err error)
ClanSearch searches for a clan using the provided parmameters. https://docs.royaleapi.com/#/endpoints/clan_search
func (*Client) ClanTracking ¶ added in v0.3.0
ClanTracking returns basic data on whether a clan is tracked. https://docs.royaleapi.com/#/endpoints/clan_tracking
func (*Client) ClanWar ¶ added in v0.3.0
ClanWar returns data about the current clan war. https://docs.royaleapi.com/#/endpoints/clan_war
func (*Client) ClanWarLog ¶ added in v0.3.0
ClanWarLog returns data about past clan wars. https://docs.royaleapi.com/#/endpoints/clan_warlog
func (*Client) ClanWeeklyHistory ¶ added in v0.3.0
func (c *Client) ClanWeeklyHistory(tag string, params url.Values) (history []ClanHistoryEntry, err error)
ClanWeeklyHistory works like ClanHistory but returns weekly stats. https://docs.royaleapi.com/#/endpoints/clan_history_weekly
func (*Client) Clans ¶ added in v0.3.0
Clans works like Clan but can return multiple clans. https://docs.royaleapi.com/#/endpoints/clan?id=multiple-clans
func (*Client) Constants ¶ added in v0.3.0
Constants returns constants from the API. https://docs.royaleapi.com/#/endpoints/constants
func (*Client) Endpoints ¶ added in v0.3.0
Endpoints returns all the available endpoints for the API. It does not have any special incorporation with this wrapper and is simply included for completion's sake. https://docs.royaleapi.com/#/endpoints/endpoints
func (*Client) Get1kTournaments ¶ added in v0.2.0
func (c *Client) Get1kTournaments(params url.Values) (tournaments []Tournament1k, err error)
Get1kTournaments returns a slice of tournaments that have 1000 MaxPlayers.
func (*Client) KnownTournaments ¶ added in v0.3.0
func (c *Client) KnownTournaments(params url.Values) (tournaments []Tournament, err error)
KnownTournaments returns a slice of tournaments people have searched for. https://docs.royaleapi.com/#/endpoints/tournaments_known
func (*Client) OpenTournaments ¶ added in v0.3.0
func (c *Client) OpenTournaments(params url.Values) (tournaments []Tournament, err error)
OpenTournaments returns a slice of open tournaments. https://docs.royaleapi.com/#/endpoints/tournaments_open
func (*Client) Player ¶ added in v0.3.0
Player retrieves a player by their tag. https://docs.royaleapi.com/#/endpoints/player
func (*Client) PlayerBattles ¶ added in v0.3.0
PlayerBattles s battles a player participated in. https://docs.royaleapi.com/#/endpoints/player_battles
func (*Client) PlayerChests ¶ added in v0.3.0
PlayerChests s a player's upcoming chests. https://docs.royaleapi.com/#/endpoints/player_chests
func (*Client) Players ¶ added in v0.3.0
Players works like Player but can return multiple players. The API asks that you don't include more than 7 tags in this request. https://docs.royaleapi.com/#/endpoints/player?id=multiple-players
func (*Client) PlayersBattles ¶ added in v0.3.0
PlayersBattles works like PlayerBattles but can return battles from multiple players. https://docs.royaleapi.com/#/endpoints/player_battles?id=multiple-tags
func (*Client) PlayersChests ¶ added in v0.3.0
PlayersChests works like PlayerChests but can return chests for multiple players. https://docs.royaleapi.com/#/endpoints/player_chests?id=multiple-players
func (*Client) PopularClans ¶ added in v0.3.0
func (c *Client) PopularClans(params url.Values) (popularClans []PopularClan, err error)
PopularClans returns stats on how often a clan's data has been requested from the API. https://docs.royaleapi.com/#/endpoints/popular_clans
func (*Client) PopularDecks ¶ added in v0.3.0
func (c *Client) PopularDecks(params url.Values) (popularDecks []PopularDeck, err error)
PopularDecks returns stats on how often a deck's data has been requested from the API. https://docs.royaleapi.com/#/endpoints/popular_decks
func (*Client) PopularPlayers ¶ added in v0.3.0
func (c *Client) PopularPlayers(params url.Values) (popularPlayers []PopularPlayer, err error)
PopularPlayers returns stats on how often a player's data has been request from the API. https://docs.royaleapi.com/#/endpoints/popular_players
func (*Client) PopularTournaments ¶ added in v0.3.0
func (c *Client) PopularTournaments(params url.Values) (popularTournaments []PopularTournament, err error)
PopularTournaments returns stats on how often a tournament's data has been request from the API. https://docs.royaleapi.com/#/endpoints/popular_tournaments
func (*Client) PrepTournaments ¶ added in v0.3.0
func (c *Client) PrepTournaments(params url.Values) (tournaments []PrepTournament, err error)
PrepTournaments returns a slice of tournaments that have a Status of "inPreparation".
func (*Client) TopClans ¶ added in v0.3.0
TopClans returns the top 200 clans of a location/global leaderboard. https://docs.royaleapi.com/#/endpoints/top_clans
func (*Client) TopPlayers ¶ added in v0.3.0
TopPlayers returns the top 200 players of a location/global leaderboard. https://docs.royaleapi.com/#/endpoints/top_players
func (*Client) Tournament ¶ added in v0.3.0
func (c *Client) Tournament(tag string, params url.Values) (tournament SpecificTournament, err error)
Tournament returns the specified Tournament by tag. https://docs.royaleapi.com/#/endpoints/tournaments
func (*Client) TournamentSearch ¶
func (c *Client) TournamentSearch(params url.Values) (tournaments []SearchedTournament, err error)
TournamentSearch returns a slice of tournaments by a name to search for. https://docs.royaleapi.com/#/endpoints/tournaments_search
func (*Client) Tournaments ¶ added in v0.3.0
func (c *Client) Tournaments(tags []string, params url.Values) (tournaments []SpecificTournament, err error)
Tournaments works like Tournament but can return multiple SpecificTournaments. https://docs.royaleapi.com/#/endpoints/tournaments?id=multiple-tournaments
type Constants ¶
type Constants struct {
AllianceBadges []struct {
Name string `json:"name"`
Category string `json:"category"`
ID int `json:"id"`
} `json:"alliance_badges"`
Arenas []struct {
Name string `json:"name"`
Arena int `json:"arena"`
ChestArena string `json:"chest_arena"`
TvArena string `json:"tv_arena"`
IsInUse bool `json:"is_in_use"`
TrainingCamp bool `json:"training_camp"`
TrophyLimit int `json:"trophy_limit"`
DemoteTrophyLimit int `json:"demote_trophy_limit"`
SeasonTrophyReset int `json:"season_trophy_reset"`
ChestRewardMultiplier int `json:"chest_reward_multiplier"`
ShopChestRewardMultiplier int `json:"shop_chest_reward_multiplier"`
RequestSize int `json:"request_size"`
MaxDonationCountCommon int `json:"max_donation_count_common"`
MaxDonationCountRare int `json:"max_donation_count_rare"`
MaxDonationCountEpic int `json:"max_donation_count_epic"`
MatchmakingMinTrophyDelta int `json:"matchmaking_min_trophy_delta"`
MatchmakingMaxTrophyDelta int `json:"matchmaking_max_trophy_delta"`
MatchmakingMaxSeconds int `json:"matchmaking_max_seconds"`
DailyDonationCapacityLimit int `json:"daily_donation_capacity_limit"`
BattleRewardGold int `json:"battle_reward_gold"`
SeasonRewardChest string `json:"season_reward_chest"`
QuestCycle string `json:"quest_cycle"`
ForceQuestChestCycle string `json:"force_quest_chest_cycle"`
Key string `json:"key"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
ArenaID int `json:"arena_id"`
// Either int or string
LeagueID interface{} `json:"league_id"`
ID int `json:"id"`
} `json:"arenas"`
Cards []struct {
Key string `json:"key"`
Name string `json:"name"`
Elixir int `json:"elixir"`
Type string `json:"type"`
Rarity string `json:"rarity"`
Arena int `json:"arena"`
Description string `json:"description"`
ID int `json:"id"`
} `json:"cards"`
CardsStats struct {
Troop []struct {
Name string `json:"name"`
Rarity string `json:"rarity"`
SightRange int `json:"sight_range"`
DeployTime int `json:"deploy_time"`
Speed int `json:"speed,omitempty"`
Hitpoints int `json:"hitpoints"`
HitSpeed int `json:"hit_speed"`
LoadTime int `json:"load_time"`
Damage int `json:"damage,omitempty"`
LoadFirstHit bool `json:"load_first_hit"`
LoadAfterRetarget bool `json:"load_after_retarget"`
AllTargetsHit bool `json:"all_targets_hit"`
Range int `json:"range"`
AttacksGround bool `json:"attacks_ground"`
AttacksAir bool `json:"attacks_air"`
TargetOnlyBuildings bool `json:"target_only_buildings"`
CrowdEffects bool `json:"crowd_effects"`
IgnorePushback bool `json:"ignore_pushback"`
Scale int `json:"scale"`
CollisionRadius int `json:"collision_radius"`
Mass int `json:"mass"`
ShowHealthNumber bool `json:"show_health_number"`
FlyDirectPaths bool `json:"fly_direct_paths"`
FlyFromGround bool `json:"fly_from_ground"`
HealOnMorph bool `json:"heal_on_morph"`
MorphKeepTarget bool `json:"morph_keep_target"`
DestroyAtLimit bool `json:"destroy_at_limit"`
DeathSpawnPushback bool `json:"death_spawn_pushback"`
DeathInheritIgnoreList bool `json:"death_inherit_ignore_list"`
Kamikaze bool `json:"kamikaze"`
ProjectileStartRadius int `json:"projectile_start_radius,omitempty"`
ProjectileStartZ int `json:"projectile_start_z,omitempty"`
DontStopMoveAnim bool `json:"dont_stop_move_anim"`
IsSummonerTower bool `json:"is_summoner_tower"`
SelfAsAoeCenter bool `json:"self_as_aoe_center"`
HidesWhenNotAttacking bool `json:"hides_when_not_attacking"`
HideBeforeFirstHit bool `json:"hide_before_first_hit"`
SpecialAttackWhenHidden bool `json:"special_attack_when_hidden"`
HasRotationOnTimeline bool `json:"has_rotation_on_timeline"`
JumpEnabled bool `json:"jump_enabled"`
RetargetAfterAttack bool `json:"retarget_after_attack"`
BurstKeepTarget bool `json:"burst_keep_target"`
BurstAffectAnimation bool `json:"burst_affect_animation"`
BuildingTarget bool `json:"building_target"`
SpawnConstPriority bool `json:"spawn_const_priority"`
NameEn string `json:"name_en"`
Key string `json:"key,omitempty"`
Elixir int `json:"elixir,omitempty"`
Type string `json:"type,omitempty"`
Arena int `json:"arena,omitempty"`
Description string `json:"description,omitempty"`
ID int `json:"id,omitempty"`
SpeedEn string `json:"speed_en"`
Dps float64 `json:"dps"`
Projectile string `json:"projectile,omitempty"`
DeployDelay int `json:"deploy_delay,omitempty"`
StopMovementAfterMs int `json:"stop_movement_after_ms,omitempty"`
WaitMs int `json:"wait_ms,omitempty"`
SightClip int `json:"sight_clip,omitempty"`
SightClipSide int `json:"sight_clip_side,omitempty"`
WalkingSpeedTweakPercentage int `json:"walking_speed_tweak_percentage,omitempty"`
FlyingHeight int `json:"flying_height,omitempty"`
DeathSpawnCharacter string `json:"death_spawn_character,omitempty"`
SpawnStartTime int `json:"spawn_start_time,omitempty"`
SpawnInterval int `json:"spawn_interval,omitempty"`
SpawnNumber int `json:"spawn_number,omitempty"`
SpawnPauseTime int `json:"spawn_pause_time,omitempty"`
SpawnCharacterLevelIndex int `json:"spawn_character_level_index,omitempty"`
SpawnCharacter string `json:"spawn_character,omitempty"`
DeathDamageRadius int `json:"death_damage_radius,omitempty"`
DeathDamage int `json:"death_damage,omitempty"`
DeathPushBack int `json:"death_push_back,omitempty"`
DeathSpawnCount int `json:"death_spawn_count,omitempty"`
DeathSpawnRadius int `json:"death_spawn_radius,omitempty"`
AreaDamageRadius int `json:"area_damage_radius,omitempty"`
SpawnRadius int `json:"spawn_radius,omitempty"`
ChargeRange int `json:"charge_range,omitempty"`
DamageSpecial int `json:"damage_special,omitempty"`
DamageEffectSpecial string `json:"damage_effect_special,omitempty"`
ChargeSpeedMultiplier int `json:"charge_speed_multiplier,omitempty"`
JumpHeight int `json:"jump_height,omitempty"`
JumpSpeed int `json:"jump_speed,omitempty"`
CustomFirstProjectile string `json:"custom_first_projectile,omitempty"`
MultipleProjectiles int `json:"multiple_projectiles,omitempty"`
ShieldHitpoints int `json:"shield_hitpoints,omitempty"`
CrownTowerDamagePercent int `json:"crown_tower_damage_percent,omitempty"`
SpawnPathfindSpeed int `json:"spawn_pathfind_speed,omitempty"`
AttackPushBack int `json:"attack_push_back,omitempty"`
ProjectileEffectSpecial string `json:"projectile_effect_special,omitempty"`
LoadAttackEffect1 string `json:"load_attack_effect1,omitempty"`
LoadAttackEffect2 string `json:"load_attack_effect2,omitempty"`
LoadAttackEffect3 string `json:"load_attack_effect3,omitempty"`
LoadAttackEffectReady string `json:"load_attack_effect_ready,omitempty"`
RotateAngleSpeed int `json:"rotate_angle_speed,omitempty"`
VariableDamage2 int `json:"variable_damage2,omitempty"`
VariableDamageTime1 int `json:"variable_damage_time1,omitempty"`
VariableDamage3 int `json:"variable_damage3,omitempty"`
VariableDamageTime2 int `json:"variable_damage_time2,omitempty"`
TargettedDamageEffect1 string `json:"targetted_damage_effect1,omitempty"`
TargettedDamageEffect2 string `json:"targetted_damage_effect2,omitempty"`
TargettedDamageEffect3 string `json:"targetted_damage_effect3,omitempty"`
FlameEffect1 string `json:"flame_effect1,omitempty"`
FlameEffect2 string `json:"flame_effect2,omitempty"`
FlameEffect3 string `json:"flame_effect3,omitempty"`
TargetEffectY int `json:"target_effect_y,omitempty"`
VisualHitSpeed int `json:"visual_hit_speed,omitempty"`
SpawnDeployBaseAnim string `json:"spawn_deploy_base_anim,omitempty"`
SpawnAngleShift int `json:"spawn_angle_shift,omitempty"`
DeathSpawnDeployTime int `json:"death_spawn_deploy_time,omitempty"`
AttackShakeTime int `json:"attack_shake_time,omitempty"`
MultipleTargets int `json:"multiple_targets,omitempty"`
BuffOnDamage string `json:"buff_on_damage,omitempty"`
BuffOnDamageTime int `json:"buff_on_damage_time,omitempty"`
SpawnAreaObject string `json:"spawn_area_object,omitempty"`
SpawnAreaObjectLevelIndex int `json:"spawn_area_object_level_index,omitempty"`
DashImmuneToDamageTime int `json:"dash_immune_to_damage_time,omitempty"`
DashCooldown int `json:"dash_cooldown,omitempty"`
DashDamage int `json:"dash_damage,omitempty"`
DashFilter string `json:"dash_filter,omitempty"`
DashMinRange int `json:"dash_min_range,omitempty"`
DashMaxRange int `json:"dash_max_range,omitempty"`
HideTimeMs int `json:"hide_time_ms,omitempty"`
BuffWhenNotAttacking string `json:"buff_when_not_attacking,omitempty"`
BuffWhenNotAttackingTime int `json:"buff_when_not_attacking_time,omitempty"`
AttachedCharacter string `json:"attached_character,omitempty"`
TargetedEffectVisualPushback int `json:"targeted_effect_visual_pushback,omitempty"`
AttackDashTime int `json:"attack_dash_time,omitempty"`
LoopingFilter string `json:"looping_filter,omitempty"`
LifeTime int `json:"life_time,omitempty"`
MorphTime int `json:"morph_time,omitempty"`
DashPushBack int `json:"dash_push_back,omitempty"`
DashRadius int `json:"dash_radius,omitempty"`
DashConstantTime int `json:"dash_constant_time,omitempty"`
DashLandingTime int `json:"dash_landing_time,omitempty"`
SpawnLimit int `json:"spawn_limit,omitempty"`
SpawnPushback int `json:"spawn_pushback,omitempty"`
SpawnPushbackRadius int `json:"spawn_pushback_radius,omitempty"`
KamikazeTime int `json:"kamikaze_time,omitempty"`
} `json:"troop"`
Building []struct {
Name string `json:"name"`
Rarity string `json:"rarity"`
SightRange int `json:"sight_range,omitempty"`
Hitpoints int `json:"hitpoints,omitempty"`
HitSpeed int `json:"hit_speed,omitempty"`
LoadTime int `json:"load_time,omitempty"`
LoadFirstHit bool `json:"load_first_hit"`
LoadAfterRetarget bool `json:"load_after_retarget"`
Projectile string `json:"projectile,omitempty"`
AllTargetsHit bool `json:"all_targets_hit"`
Range int `json:"range,omitempty"`
AttacksGround bool `json:"attacks_ground"`
AttacksAir bool `json:"attacks_air"`
TargetOnlyBuildings bool `json:"target_only_buildings"`
AttachedCharacterHeight int `json:"attached_character_height,omitempty"`
CrowdEffects bool `json:"crowd_effects"`
IgnorePushback bool `json:"ignore_pushback"`
Scale int `json:"scale"`
CollisionRadius int `json:"collision_radius,omitempty"`
TileSizeOverride int `json:"tile_size_override,omitempty"`
ShowHealthNumber bool `json:"show_health_number"`
FlyDirectPaths bool `json:"fly_direct_paths"`
FlyFromGround bool `json:"fly_from_ground"`
HealOnMorph bool `json:"heal_on_morph"`
MorphKeepTarget bool `json:"morph_keep_target"`
DestroyAtLimit bool `json:"destroy_at_limit"`
DeathSpawnPushback bool `json:"death_spawn_pushback"`
DeathInheritIgnoreList bool `json:"death_inherit_ignore_list"`
Kamikaze bool `json:"kamikaze"`
ProjectileStartRadius int `json:"projectile_start_radius,omitempty"`
ProjectileStartZ int `json:"projectile_start_z,omitempty"`
DontStopMoveAnim bool `json:"dont_stop_move_anim"`
IsSummonerTower bool `json:"is_summoner_tower"`
NoDeploySizeW int `json:"no_deploy_size_w,omitempty"`
NoDeploySizeH int `json:"no_deploy_size_h,omitempty"`
SelfAsAoeCenter bool `json:"self_as_aoe_center"`
HidesWhenNotAttacking bool `json:"hides_when_not_attacking"`
HideBeforeFirstHit bool `json:"hide_before_first_hit"`
SpecialAttackWhenHidden bool `json:"special_attack_when_hidden"`
HasRotationOnTimeline bool `json:"has_rotation_on_timeline"`
TurretMovement int `json:"turret_movement,omitempty"`
ProjectileYOffset int `json:"projectile_y_offset,omitempty"`
JumpEnabled bool `json:"jump_enabled"`
RetargetAfterAttack bool `json:"retarget_after_attack"`
BurstKeepTarget bool `json:"burst_keep_target"`
BurstAffectAnimation bool `json:"burst_affect_animation"`
BuildingTarget bool `json:"building_target"`
SpawnConstPriority bool `json:"spawn_const_priority"`
NameEn string `json:"name_en,omitempty"`
AttachedCharacter string `json:"attached_character,omitempty"`
DeployTime int `json:"deploy_time,omitempty"`
LifeTime int `json:"life_time,omitempty"`
Key string `json:"key,omitempty"`
Elixir int `json:"elixir,omitempty"`
Type string `json:"type,omitempty"`
Arena int `json:"arena,omitempty"`
Description string `json:"description,omitempty"`
ID int `json:"id,omitempty"`
SpawnNumber int `json:"spawn_number,omitempty"`
SpawnPauseTime int `json:"spawn_pause_time,omitempty"`
SpawnCharacterLevelIndex int `json:"spawn_character_level_index,omitempty"`
SpawnCharacter string `json:"spawn_character,omitempty"`
MinimumRange int `json:"minimum_range,omitempty"`
Damage int `json:"damage,omitempty"`
VariableDamage2 int `json:"variable_damage2,omitempty"`
VariableDamageTime1 int `json:"variable_damage_time1,omitempty"`
VariableDamage3 int `json:"variable_damage3,omitempty"`
VariableDamageTime2 int `json:"variable_damage_time2,omitempty"`
TargettedDamageEffect1 string `json:"targetted_damage_effect1,omitempty"`
TargettedDamageEffect2 string `json:"targetted_damage_effect2,omitempty"`
TargettedDamageEffect3 string `json:"targetted_damage_effect3,omitempty"`
DamageLevelTransitionEffect12 string `json:"damage_level_transition_effect12,omitempty"`
DamageLevelTransitionEffect23 string `json:"damage_level_transition_effect23,omitempty"`
FlameEffect1 string `json:"flame_effect1,omitempty"`
FlameEffect2 string `json:"flame_effect2,omitempty"`
FlameEffect3 string `json:"flame_effect3,omitempty"`
TargetEffectY int `json:"target_effect_y,omitempty"`
SpawnInterval int `json:"spawn_interval,omitempty"`
HideTimeMs int `json:"hide_time_ms,omitempty"`
UpTimeMs int `json:"up_time_ms,omitempty"`
ManaCollectAmount int `json:"mana_collect_amount,omitempty"`
ManaGenerateTimeMs int `json:"mana_generate_time_ms,omitempty"`
DeathSpawnCount int `json:"death_spawn_count,omitempty"`
DeathSpawnCharacter string `json:"death_spawn_character,omitempty"`
DeathDamageRadius int `json:"death_damage_radius,omitempty"`
DeathDamage int `json:"death_damage,omitempty"`
DeathPushBack int `json:"death_push_back,omitempty"`
DeathSpawnRadius int `json:"death_spawn_radius,omitempty"`
DeathSpawnMinRadius int `json:"death_spawn_min_radius,omitempty"`
DeathSpawnDeployTime int `json:"death_spawn_deploy_time,omitempty"`
} `json:"building"`
Spell []struct {
Name string `json:"name"`
Rarity string `json:"rarity"`
LifeDuration int `json:"life_duration"`
LifeDurationIncreasePerLevel int `json:"life_duration_increase_per_level"`
LifeDurationIncreaseAfterTournamentCap int `json:"life_duration_increase_after_tournament_cap"`
AffectsHidden bool `json:"affects_hidden"`
Radius int `json:"radius"`
HitSpeed int `json:"hit_speed"`
Damage int `json:"damage"`
NoEffectToCrownTowers bool `json:"no_effect_to_crown_towers"`
CrownTowerDamagePercent int `json:"crown_tower_damage_percent"`
HitBiggestTargets bool `json:"hit_biggest_targets"`
Buff string `json:"buff"`
BuffTime int `json:"buff_time"`
BuffTimeIncreasePerLevel int `json:"buff_time_increase_per_level"`
BuffTimeIncreaseAfterTournamentCap int `json:"buff_time_increase_after_tournament_cap"`
CapBuffTimeToAreaEffectTime bool `json:"cap_buff_time_to_area_effect_time"`
BuffNumber int `json:"buff_number"`
OnlyEnemies bool `json:"only_enemies"`
OnlyOwnTroops bool `json:"only_own_troops"`
IgnoreBuildings bool `json:"ignore_buildings"`
IgnoreHero bool `json:"ignore_hero"`
Projectile string `json:"projectile"`
SpawnCharacter string `json:"spawn_character"`
SpawnInterval int `json:"spawn_interval"`
SpawnRandomizeSequence bool `json:"spawn_randomize_sequence"`
SpawnDeployBaseAnim string `json:"spawn_deploy_base_anim"`
SpawnTime int `json:"spawn_time"`
SpawnCharacterLevelIndex int `json:"spawn_character_level_index"`
SpawnInitialDelay int `json:"spawn_initial_delay"`
SpawnMaxCount int `json:"spawn_max_count"`
SpawnMaxRadius int `json:"spawn_max_radius"`
SpawnMinRadius int `json:"spawn_min_radius"`
SpawnFromMinToMax bool `json:"spawn_from_min_to_max"`
SpawnAngleShift int `json:"spawn_angle_shift"`
HitsGround bool `json:"hits_ground"`
HitsAir bool `json:"hits_air"`
Key string `json:"key,omitempty"`
Elixir int `json:"elixir,omitempty"`
Type string `json:"type,omitempty"`
Arena int `json:"arena,omitempty"`
Description string `json:"description,omitempty"`
ID int `json:"id,omitempty"`
} `json:"spell"`
} `json:"cards_stats"`
Challenges []struct {
Name string `json:"name"`
GameMode string `json:"game_mode"`
Enabled bool `json:"enabled"`
JoinCost int `json:"join_cost"`
JoinCostResource string `json:"join_cost_resource"`
MaxWins int `json:"max_wins"`
MaxLoss int `json:"max_loss"`
RewardCards []int `json:"reward_cards"`
RewardGold []int `json:"reward_gold"`
RewardSpell string `json:"reward_spell"`
RewardSpellMaxCount int `json:"reward_spell_max_count"`
NameEn string `json:"name_en,omitempty"`
Key string `json:"key"`
ID int `json:"id"`
} `json:"challenges"`
ChestOrder struct {
MainCycle []string `json:"MainCycle"`
QuestEarlygame1 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_earlygame_1"`
QuestEarlygame2 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_earlygame_2"`
QuestLategame1 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_1"`
QuestLategame2 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_2"`
QuestLategame3 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_3"`
QuestLategame4 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_4"`
QuestLategame5 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_5"`
QuestLategame6 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_6"`
QuestLategame7 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_7"`
QuestLategame8 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_8"`
QuestLategame9 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_9"`
QuestLategame10 []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_lategame_10"`
QuestArena3Super []struct {
Chest string `json:"chest"`
ArenaThreshold string `json:"arena_threshold"`
OneTime bool `json:"one_time"`
} `json:"Quest_arena3_super"`
} `json:"chest_order"`
ClanChest struct {
OneV1 struct {
Thresholds []int `json:"thresholds"`
Gold []int `json:"gold"`
Cards []int `json:"cards"`
} `json:"1v1"`
TwoV2 struct {
Thresholds []int `json:"thresholds"`
Gold []int `json:"gold"`
Cards []int `json:"cards"`
} `json:"2v2"`
} `json:"clan_chest"`
GameModes []struct {
Name string `json:"name"`
CardLevelAdjustment string `json:"card_level_adjustment"`
DeckSelection string `json:"deck_selection"`
OvertimeSeconds int `json:"overtime_seconds"`
PredefinedDecks string `json:"predefined_decks,omitempty"`
SameDeckOnBoth bool `json:"same_deck_on_both"`
SeparateTeamDecks bool `json:"separate_team_decks"`
SwappingTowers bool `json:"swapping_towers"`
UseStartingElixir bool `json:"use_starting_elixir"`
Heroes bool `json:"heroes"`
Players string `json:"players"`
GivesClanScore bool `json:"gives_clan_score"`
FixedDeckOrder bool `json:"fixed_deck_order"`
BattleStartCooldown int `json:"battle_start_cooldown,omitempty"`
ID int `json:"id"`
NameEn string `json:"name_en"`
ElixirProductionMultiplier int `json:"elixir_production_multiplier,omitempty"`
StartingElixir int `json:"starting_elixir,omitempty"`
ClanWarDescription string `json:"clan_war_description,omitempty"`
ForcedDeckCards string `json:"forced_deck_cards,omitempty"`
ElixirProductionOvertimeMultiplier int `json:"elixir_production_overtime_multiplier,omitempty"`
EventDeckSetLimit string `json:"event_deck_set_limit,omitempty"`
GoldPerTower1 int `json:"gold_per_tower1,omitempty"`
GoldPerTower2 int `json:"gold_per_tower2,omitempty"`
GoldPerTower3 int `json:"gold_per_tower3,omitempty"`
TargetTouchdowns int `json:"target_touchdowns,omitempty"`
SkinSet string `json:"skin_set,omitempty"`
FixedArena string `json:"fixed_arena,omitempty"`
GemsPerTower1 int `json:"gems_per_tower1,omitempty"`
GemsPerTower2 int `json:"gems_per_tower2,omitempty"`
GemsPerTower3 int `json:"gems_per_tower3,omitempty"`
} `json:"game_modes"`
Rarities []struct {
Name string `json:"name"`
LevelCount int `json:"level_count"`
RelativeLevel int `json:"relative_level"`
MirrorRelativeLevel int `json:"mirror_relative_level"`
CloneRelativeLevel int `json:"clone_relative_level"`
DonateCapacity int `json:"donate_capacity"`
SortCapacity int `json:"sort_capacity"`
DonateReward int `json:"donate_reward"`
DonateXp int `json:"donate_xp"`
GoldConversionValue int `json:"gold_conversion_value"`
ChanceWeight int `json:"chance_weight"`
BalanceMultiplier int `json:"balance_multiplier"`
UpgradeExp []int `json:"upgrade_exp"`
UpgradeMaterialCount []int `json:"upgrade_material_count"`
UpgradeCost []int `json:"upgrade_cost"`
PowerLevelMultiplier []int `json:"power_level_multiplier"`
RefundGems int `json:"refund_gems"`
} `json:"rarities"`
Regions []struct {
ID int `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
IsCountry bool `json:"isCountry"`
} `json:"regions"`
Tournaments []struct {
CreateCost int `json:"create_cost"`
MaxPlayers int `json:"max_players"`
Key string `json:"key"`
Prizes []struct {
Rank int `json:"rank"`
Cards int `json:"cards"`
Tier int `json:"tier"`
} `json:"prizes"`
Cards []int `json:"cards"`
} `json:"tournaments"`
TreasureChests struct {
Cycle []struct {
Name string `json:"name"`
BaseChest interface{} `json:"base_chest"`
Arena struct {
Name string `json:"name"`
Arena int `json:"arena"`
ChestRewardMultiplier int `json:"chest_reward_multiplier"`
ShopChestRewardMultiplier int `json:"shop_chest_reward_multiplier"`
Key string `json:"key"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
} `json:"arena"`
InShop bool `json:"in_shop"`
InArenaInfo bool `json:"in_arena_info"`
TournamentChest bool `json:"tournament_chest"`
SurvivalChest bool `json:"survival_chest"`
ShopPriceWithoutSpeedUp int `json:"shop_price_without_speed_up"`
TimeTakenDays int `json:"time_taken_days"`
TimeTakenHours int `json:"time_taken_hours"`
TimeTakenMinutes int `json:"time_taken_minutes"`
TimeTakenSeconds int `json:"time_taken_seconds"`
RandomSpells int `json:"random_spells"`
DifferentSpells int `json:"different_spells"`
ChestCountInChestCycle int `json:"chest_count_in_chest_cycle"`
RareChance int `json:"rare_chance"`
EpicChance int `json:"epic_chance"`
LegendaryChance int `json:"legendary_chance"`
SkinChance int `json:"skin_chance"`
GuaranteedSpells interface{} `json:"guaranteed_spells"`
MinGoldPerCard int `json:"min_gold_per_card"`
MaxGoldPerCard int `json:"max_gold_per_card"`
SpellSet interface{} `json:"spell_set"`
Exp int `json:"exp"`
SortValue int `json:"sort_value"`
SpecialOffer bool `json:"special_offer"`
DraftChest bool `json:"draft_chest"`
BoostedChest bool `json:"boosted_chest"`
LegendaryOverrideChance int `json:"legendary_override_chance"`
Description string `json:"description"`
Notification string `json:"notification"`
CardCount int `json:"card_count"`
MinGold int `json:"min_gold"`
MaxGold int `json:"max_gold"`
Arenas []struct {
Name string `json:"name"`
Arena int `json:"arena"`
ChestRewardMultiplier int `json:"chest_reward_multiplier"`
ShopChestRewardMultiplier int `json:"shop_chest_reward_multiplier"`
Key string `json:"key"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
CardCoundByArena float64 `json:"card_count_by_arena"`
CardCountCommon float64 `json:"card_count_common"`
CardCountRare float64 `json:"card_count_rare"`
CardCountEpic float64 `json:"card_count_epic"`
CardCountLegendary float64 `json:"card_count_legendary"`
} `json:"arenas"`
} `json:"cycle"`
Crown []struct {
Name string `json:"name"`
BaseChest interface{} `json:"base_chest"`
Arena struct {
Name string `json:"name"`
Arena int `json:"arena"`
ChestRewardMultiplier int `json:"chest_reward_multiplier"`
ShopChestRewardMultiplier int `json:"shop_chest_reward_multiplier"`
Key string `json:"key"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
} `json:"arena"`
InShop bool `json:"in_shop"`
InArenaInfo bool `json:"in_arena_info"`
TournamentChest bool `json:"tournament_chest"`
SurvivalChest bool `json:"survival_chest"`
ShopPriceWithoutSpeedUp int `json:"shop_price_without_speed_up"`
TimeTakenDays int `json:"time_taken_days"`
TimeTakenHours int `json:"time_taken_hours"`
TimeTakenMinutes int `json:"time_taken_minutes"`
TimeTakenSeconds int `json:"time_taken_seconds"`
RandomSpells int `json:"random_spells"`
DifferentSpells int `json:"different_spells"`
ChestCountInChestCycle int `json:"chest_count_in_chest_cycle"`
RareChance int `json:"rare_chance"`
EpicChance int `json:"epic_chance"`
LegendaryChance int `json:"legendary_chance"`
SkinChance int `json:"skin_chance"`
GuaranteedSpells interface{} `json:"guaranteed_spells"`
MinGoldPerCard int `json:"min_gold_per_card"`
MaxGoldPerCard int `json:"max_gold_per_card"`
SpellSet interface{} `json:"spell_set"`
Exp int `json:"exp"`
SortValue int `json:"sort_value"`
SpecialOffer bool `json:"special_offer"`
DraftChest bool `json:"draft_chest"`
BoostedChest bool `json:"boosted_chest"`
LegendaryOverrideChance int `json:"legendary_override_chance"`
Description string `json:"description"`
Notification string `json:"notification"`
CardCount int `json:"card_count"`
MinGold int `json:"min_gold"`
MaxGold int `json:"max_gold"`
Arenas []interface{} `json:"arenas"`
} `json:"crown"`
Shop []struct {
Name string `json:"name"`
BaseChest interface{} `json:"base_chest"`
Arena struct {
Name string `json:"name"`
Arena int `json:"arena"`
ChestRewardMultiplier int `json:"chest_reward_multiplier"`
ShopChestRewardMultiplier int `json:"shop_chest_reward_multiplier"`
Key string `json:"key"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
} `json:"arena"`
InShop bool `json:"in_shop"`
InArenaInfo bool `json:"in_arena_info"`
TournamentChest bool `json:"tournament_chest"`
SurvivalChest bool `json:"survival_chest"`
ShopPriceWithoutSpeedUp int `json:"shop_price_without_speed_up"`
TimeTakenDays int `json:"time_taken_days"`
TimeTakenHours int `json:"time_taken_hours"`
TimeTakenMinutes int `json:"time_taken_minutes"`
TimeTakenSeconds int `json:"time_taken_seconds"`
RandomSpells int `json:"random_spells"`
DifferentSpells int `json:"different_spells"`
ChestCountInChestCycle int `json:"chest_count_in_chest_cycle"`
RareChance int `json:"rare_chance"`
EpicChance int `json:"epic_chance"`
LegendaryChance int `json:"legendary_chance"`
SkinChance int `json:"skin_chance"`
GuaranteedSpells interface{} `json:"guaranteed_spells"`
MinGoldPerCard int `json:"min_gold_per_card"`
MaxGoldPerCard int `json:"max_gold_per_card"`
SpellSet interface{} `json:"spell_set"`
Exp int `json:"exp"`
SortValue int `json:"sort_value"`
SpecialOffer bool `json:"special_offer"`
DraftChest bool `json:"draft_chest"`
BoostedChest bool `json:"boosted_chest"`
LegendaryOverrideChance int `json:"legendary_override_chance"`
Description string `json:"description"`
CardCount int `json:"card_count"`
MinGold int `json:"min_gold"`
MaxGold int `json:"max_gold"`
Arenas []interface{} `json:"arenas"`
} `json:"shop"`
} `json:"treasure_chests"`
}
Constants represents API constants. https://docs.royaleapi.com/#/endpoints/constants
type FavoriteCard ¶
type FavoriteCard struct {
Name string
ID int
MaxLevel int
Icon string
Key string
Elixir int
Type string
Rarity string
Arena int
Description string
}
FavoriteCard is part of PlayerStats.
type LeagueStatistics ¶
type LeagueStatistics struct {
CurrentSeason struct {
Rank int
Trophies int
BestTrophies int
}
PreviousSeason struct {
ID string
Trophies int
BestTrophies int
}
BestSeason struct {
ID string
Rank int
Trophies int
}
}
LeagueStatistics represents a player's season stats.
type Player ¶
type Player struct {
Tag string
Name string
Trophies int
Rank int // Player's global ranking
Arena Arena
Clan PlayerClan
Stats PlayerStats
Games PlayerGames
LeagueStatistics LeagueStatistics
DeckLink string // Link to copy the player's deck
CurrentDeck []Card
Achievements []Achievement
}
Player represents a player's profile with basic stats and card collection. https://docs.royaleapi.com/#/endpoints/player
type PlayerChests ¶
type PlayerChests struct {
Upcoming []string
SuperMagical int
Magical int
Legendary int
Epic int
Giant int
}
PlayerChests represents info on upcoming chests for a player. https://docs.royaleapi.com/#/endpoints/player_chests
type PlayerClan ¶
type PlayerClan struct {
Tag string
Name string
Role string
Donations int
DonationsReceived int
DonationsDelta int
Badge Badge
}
PlayerClan represents a player's stats within a clan.
type PlayerGames ¶
type PlayerGames struct {
Total int
TournamentGames int
Wins int
WinsPercent float64
Losses int
LossesPercent float64
Draws int
DrawsPercent float64
}
PlayerGames is general stats on the amount and types of games a Player has played.
type PlayerStats ¶
type PlayerStats struct {
TournamentCardsWon int
MaxTrophies int
ThreeCrownWins int
CardsFound int
FavoriteCard FavoriteCard
TotalDonations int
ChallengeMaxWins int
ChallengeCardsWon int
Level int
}
PlayerStats represents stats from a player's profile.
type PopularClan ¶
type PopularClan struct {
Popularity Popularity
Tag string
Name string
Description string
Type string
Score int
MemberCount int
RequiredScore int
Donations int
ClanChest ClanChest
Badge Badge
Location Location
Members []ClanMember
Tracking Tracking
}
PopularClan represents data on how often a clan has been requested from the API. https://docs.royaleapi.com/#/endpoints/popular_clans
type PopularDeck ¶
type PopularDeck struct {
Popularity int
Cards []PopularDeckCard
DeckLink string
}
PopularDeck represents info on how often a deck's data has been requested from the API. https://docs.royaleapi.com/#/endpoints/popular_decks
type PopularDeckCard ¶
type PopularDeckCard struct {
Arena int
Description string
Elixir int
Icon string
ID int
Key string
MaxLevel int
Name string
Rarity string
Type string
}
PopularDeckCard represents a card within a deck returned by the popular decks endpoint.
type PopularPlayer ¶
type PopularPlayer struct {
Popularity Popularity
Tag string
Name string
Trophies int
Rank int
Arena Arena
Clan PlayerClan
Stats PlayerStats
Games PlayerGames
DeckLink string
CurrentDeck []Card
Cards []Card
Achievements []Achievement
}
PopularPlayer represents data on how often a player has been requested from the API. https://docs.royaleapi.com/#/endpoints/popular_players
type PopularTournament ¶
type PopularTournament struct {
Popularity Popularity
Tag string
Open bool
Status string
Name string
Description string
MaxPlayers int
PrepTime int
Duration int
CreateTime int
StartTime int
EndTime int
CurrentPlayers int
Creator TournamentMember
Members []TournamentMember
}
PopularTournament represents info on how often a tournament has been requested from the API. https://docs.royaleapi.com/#/endpoints/popular_tournaments
type Popularity ¶
Popularity represents how popular an item is.
type PrepTournament ¶ added in v0.2.0
type PrepTournament struct {
Tournament
UpdatedAt int
}
PrepTournament is a tournament returned from GetPrepTournaments. It always has Status set to "inPreparation".
type SearchedTournament ¶ added in v0.2.0
type SearchedTournament struct {
Tag string
Open bool
Status string
CreatorTag string
Name string
MaxPlayers int
PrepTime int
Duration int
CreateTime int
StartTime int
EndTime int
CurrentPlayers int
Members []TournamentMember
}
SearchedTournament represents a tournament that was returned from Client.TournamentSearch(). https://docs.royaleapi.com/#/endpoints/tournaments_search
type SpecificTournament ¶ added in v0.2.0
type SpecificTournament struct {
Tournament
Description string
Creator TournamentMember
Members []TournamentMember
}
SpecificTournament represents a tournament retrieved by tag with extra info included. https://docs.royaleapi.com/#/endpoints/tournaments_known
type TeamMember ¶
type TeamMember struct {
Tag string
Name string
CrownsEarned int
TrophyChange int
StartTrophies int
Clan TeamClan
DeckLink string
Deck []Card
}
TeamMember represents a member of a side within a PlayerBattle
type TopClan ¶
type TopClan struct {
Tag string
Name string
Score int
MemberCount int
Rank int
PreviousRank int
Badge Badge
Location Location
}
TopClan is a clan from the leaderboards. https://docs.royaleapi.com/#/endpoints/top_clans
type TopPlayer ¶
type TopPlayer struct {
Name string
Tag string
Rank int
PreviousRank int
EXPLevel int
Trophies int
DonationsDelta int
Clan TeamClan
Arena Arena
}
TopPlayer is a player from the leaderboards. https://docs.royaleapi.com/#/endpoints/top_players
type Tournament ¶
type Tournament struct {
Tag string
Open bool
Status string
Name string
Capacity int
CurrentPlayers int
MaxPlayers int
PrepTime int
Duration int
CreateTime int
StartTime int
EndTime int
}
Tournament is a basic tournament, other Tournament structs will have more info. https://docs.royaleapi.com/#/endpoints/tournaments_open
type Tournament1k ¶ added in v0.2.0
type Tournament1k struct {
Tournament
UpdatedAt int
}
Tournament1k is a tournament returned from Get1kTournaments. It always has 1000 MaxPlayers.
type TournamentMember ¶
TournamentMember represents a member who participated in a tournament.