Class: UserComponent

Components.UserComponent()

User-related API component

Constructor

new UserComponent()

Source:
Example
api.user
    .get('4222959')
    .then(console.log);

Methods

get(user, modeopt, eventDaysopt, lookupTypeopt) → {Promise.<(Object|User)>}

Gets general user information.
Parameters:
Name Type Attributes Description
user String The username or id to lookup.
mode Mode <optional>
The gamemode.
eventDays Number <optional>
The max number of event days.
lookupType LookupType <optional>
The lookup type, id/string to lookup the user.
Source:
Returns:
The object from the API, or User object if parsing is enabled.
Type
Promise.<(Object|User)>

getBest(user, modeopt, limitopt, lookupTypeopt) → {Promise.<(Array.<Object>|Array.<UserScore>)>}

Gets the top scores for the user specified.
Parameters:
Name Type Attributes Description
user String The username or id to lookup.
mode Mode <optional>
The gamemode.
limit Number <optional>
Amount of results to limit to.
lookupType LookupType <optional>
The lookup type, id/string to lookup the user.
Source:
Returns:
The object array from the API, or UserScore object array if parsing is enabled.
Type
Promise.<(Array.<Object>|Array.<UserScore>)>

getRecent(user, modeopt, limitopt, lookupTypeopt) → {Promise.<(Array.<Object>|Array.<UserScore>)>}

Gets the recent plays for the user specified.
Parameters:
Name Type Attributes Description
user String The username or id to lookup.
mode Mode <optional>
The gamemode.
limit Number <optional>
Amount of results to limit to.
lookupType LookupType <optional>
The lookup type, id/string to lookup the user.
Source:
Returns:
The object array from the API, or UserScore object array if parsing is enabled.
Type
Promise.<(Array.<Object>|Array.<UserScore>)>