Get user
The getUser
method on a LegacyClient
instance makes a GET
request to the get_user
endpoint and returns a user if it exists, otherwise null.
Example
const user = await legacyApi.getUser({
u: 14544646
});
Parameters
Parameter | Type | Optional | Description |
---|---|---|---|
params | GetUserParams | The request’s URL parameters | |
params.u | string | number | ✓ | User with a specific user ID or username |
params.m | GameMode | ✓ | Beatmaps from a specific gamemode |
params.type | UserType | ✓ | Specify if u is a user ID (id ) or a username (string ) |
params.event_days | number | ✓ | Max. number of days between now and the last event’s date (range: 1-31) |
Returns
Promise<LegacyUser | null>;
Types
Possible Exceptions
See the error handling documentation for more information.
invalid_json_syntax
network_error
unexpected_response
Notice that something is missing? Found a typo? Think something's incomplete? Or think that something can be explained better? Feel free to open a pull request or submit an issue on the library's Github repository .