new Player(playerId, data)
Player instance object.
Parameters:
Name | Type | Description |
---|---|---|
playerId |
string | player ID |
data |
object | player raw data |
Methods
-
getAvatarUrl() → {string}
-
Return the avatar url of the player
Returns:
url
- Type
- string
-
getData() → {object}
-
Return the player raw data.
Returns:
- Type
- object
-
getGeo(key) → {Object|string}
-
Return the location Object for the player, or a field value
Parameters:
Name Type Argument Description key
string <optional>
facultative field key (id, adminLevel, countryCode, formatted or title)
Returns:
- Type
- Object | string
-
getId() → {string}
-
Return the player's identifier (playerId).
Returns:
Player ID
- Type
- string
-
getNickname() → {string}
-
Return the player's nickname.
Returns:
nickname
- Type
- string
-
getValue() → {mixed}
-
Get a player's data key
Returns:
- Type
- mixed
-
setData()
-
Set the player raw data.
-
showFriends(parameters, options)
-
Display a web client with the list of friends of the player.
Parameters:
Name Type Description parameters
object key/value pair of query string parameters
options
object key/value pair of WebClient options
-
showProfile(parameters, options)
-
Display a web client with the profile of the player.
Parameters:
Name Type Description parameters
object key/value pair of query string parameters
options
object key/value pair of WebClient options