Constructor
new UserCard(client, data)
Parameters:
Name | Type | Description |
---|---|---|
client | Discord. | Discord client |
data | UserEntry | Data extracted from the database/cache |
- Source
Extends
Members
achievements :Array.<Achievement>
- Users achievements
Type:
- Array.<Achievement>
- Source
client :Discord.Client
- Discord Client
Type:
- Discord.
Client
- Overrides
- Source
id :Discord.Snowflake
- Users Id
Type:
- Discord.
Snowflake
- Source
level :Number
Users level
Type:
- Number
- Source
maxXpToLevelUp :Number
Users xp needed to level up
Type:
- Number
- Source
rank :Rank
- Users rank
Type:
- Source
username :String
- Users username
Type:
- String
- Source
xp :Number
- Users actual xp
Type:
- Number
- Source
Methods
achievementProgress(achievement, progress) → {Boolean}
Updates a achievement progress and unlocks it if the progress is equal or greater than the achievement's max progress. The new progress will overwrite the old progress so if you want add more progress to the achievement you need to add the old progress to the new progress.
Parameters:
Name | Type | Description |
---|---|---|
achievement | Achievement | Achievement to update. |
progress | Number | Progress to update. |
- Source
Returns:
- If the achievement was unlocked.
- Type:
- Boolean
Example
user.achievementProgress(achievement, achievement.progress[0] + 10)
toJSON() → {UserEntry}
Returns the user as a JSON object.
- Source
Returns:
- Type:
- UserEntry