new BanchoUser(banchojs, ircUsername)
Optional properties are filled after fetching the API with fetchFromAPI().
Parameters:
Name | Type | Description |
---|---|---|
banchojs |
BanchoClient | Bancho.js client this user was instancied by |
ircUsername |
string |
- Source:
Properties:
Name | Type | Argument | Description |
---|---|---|---|
banchojs |
BanchoClient | Bancho.js client this user was instancied by |
|
ircUsername |
string | ||
id |
number |
<optional> |
|
username |
string |
<optional> |
|
joinDate |
Date |
<optional> |
|
count300 |
number |
<optional> |
|
count100 |
number |
<optional> |
|
count50 |
number |
<optional> |
|
playcount |
number |
<optional> |
|
rankedScore |
number |
<optional> |
|
totalScore |
number |
<optional> |
|
ppRank |
number |
<optional> |
|
level |
number |
<optional> |
|
ppRaw |
number |
<optional> |
|
accuracy |
number |
<optional> |
|
countRankSS |
number |
<optional> |
|
countRankS |
number |
<optional> |
|
countRankA |
number |
<optional> |
|
country |
number |
<optional> |
|
totalSecondsPlayed |
number |
<optional> |
|
ppCountryRank |
number |
<optional> |
|
events |
Array.<nodesu.UserEvent> |
<optional> |
Extends
- EventEmitter
Methods
-
<async> fetchFromAPI()
-
Fetch the user from the osu! API if possible. Populates all the "optional" properties of BanchoUser.
- Source:
Throws:
-
osu! API/no API key error
- Type
- Error
Returns:
Promise<nodesu.User>
-
isClient()
-
Returns true if the user is the client
- Source:
Returns:
- Type
- boolean
-
<async> sendAction(message)
-
Sends an ACTION message to this user.
Parameters:
Name Type Description message
string - Source:
Throws:
-
If we're offline
- Type
- Error
Returns:
Resolves when message is sent (rate-limiting)
- Type
- Promise.<null>
-
<async> sendMessage(message)
-
Sends a PM to this user.
Parameters:
Name Type Description message
string - Source:
Throws:
-
If we're offline
- Type
- Error
Returns:
Resolves when message is sent (rate-limiting)
- Type
- Promise.<null>
-
<async> stats()
-
Fires a !stats command to BanchoBot about this user. Works on online and offline users.
Will update the username, id, rankedScore, ppRank and playcount properties of this user.
Status, levels and accuracy are stored in the returned object, as they are inaccurate data (missing decimals).
It is recommended to get levels and accuracy by polling the osu! API instead.
Throws if the user can't be found.- Source:
Returns:
- Type
- Promise.<BanchoBotStatsReturn>
-
<async> where()
-
Fires a !where command to BanchoBot about this user. Only works on online users.
Throws if the user can't be found or is offline.- Source:
Returns:
- Type
- Promise.<string>
-
<async> whois()
-
Fires an IRC WHOIS request to the server about this user. Only works on online users.
Throws if the user can't be found or is offline.- Source:
Returns:
- Type
- Promise.<BanchoWhoisReturn>
Events
-
message
-
Emitted when a message is received from a BanchoUser
Type: PrivateMessage
- Source: