🏆Rank
Classes
Functions
setAvatar(avatarUrl, AvatarDecorationData, squareAvatar) ⇒ Rank
Set the user avatar
setBanner(bannerUrl, moreBackgroundBlur, disableBackgroundBlur, backgroundBrightness) ⇒ Rank
Set the user banner
setBadges(flags, bot, frame, customBadges) ⇒ Rank
Set the user badges and frame
setBorder(color, allign) ⇒ Rank
Set the border of the card
setUsername(name, [discriminator], [color], customUsername, customTag) ⇒ Rank
Set the username of the user
setCurrentXP(data, [color]) ⇒ Rank
Set the current experience
setRequiredXP(data, [color]) ⇒ Rank
Set the required experience
setRank(data, [text], [display]) ⇒ Rank
Set the user rank
Establece el nivel del usuario
setProgressBar(color, [fillType], [rounded]) ⇒ Rank
Set the progress bar
setStatus(presenceStatus) ⇒ Rank
Set the user presence status
setCreatedTimestamp(timestamp, customDate) ⇒ Rank
Set the user created timestamp
build([font]) ⇒ Promise.<Buffer>
Build the rank card
Rank
Kind: global class
new Rank(userId)
Rank card creator
Param | Type | Description |
---|---|---|
userId |
| User ID |
Example
setAvatar(avatarUrl, AvatarDecorationData, squareAvatar) ⇒ Rank
Rank
Set the user avatar
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Description |
---|---|---|
avatarUrl |
| Avatar URL |
AvatarDecorationData |
| Avatar decoration asset |
squareAvatar |
| Square avatar |
setBanner(bannerUrl, moreBackgroundBlur, disableBackgroundBlur, backgroundBrightness) ⇒ Rank
Rank
Set the user banner
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Description |
---|---|---|
bannerUrl |
| Banner URL |
moreBackgroundBlur |
| More background blur |
disableBackgroundBlur |
| Disable background blur |
backgroundBrightness |
| Background brightness |
setBadges(flags, bot, frame, customBadges) ⇒ Rank
Rank
Set the user badges and frame
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Description |
---|---|---|
flags |
| User flags |
bot |
| Whether the user is a bot or not |
frame |
| Badge frame |
customBadges |
| Custom badges |
setBorder(color, allign) ⇒ Rank
Rank
Set the border of the card
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Description |
---|---|---|
color |
| HEX color of the border, can be gradient if 2 colors are used |
allign |
| Gradient alignment if 2 colors are used |
setUsername(name, [discriminator], [color], customUsername, customTag) ⇒ Rank
Rank
Set the username of the user
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Default | Description |
---|---|---|---|
name |
| Username of the user | |
[discriminator] |
|
| Discriminator of the user |
[color] |
|
| Color of the username |
customUsername |
| Custom username | |
customTag |
| Custom tag |
setCurrentXP(data, [color]) ⇒ Rank
Rank
Set the current experience
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Default | Description |
---|---|---|---|
data |
| Current experience data | |
[color] |
|
| Text color |
setRequiredXP(data, [color]) ⇒ Rank
Rank
Set the required experience
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Default | Description |
---|---|---|---|
data |
| Required experience data | |
[color] |
|
| Text color |
setRank(data, [text], [display]) ⇒ Rank
Rank
Set the user rank
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Default | Description |
---|---|---|---|
data |
| Rank data | |
[text] |
|
| Display text |
[display] |
|
| Display system rank or not |
setLevel(data, [text]) ⇒ Rank
Rank
Establece el nivel del usuario
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Default | Description |
---|---|---|---|
data |
| Level data | |
[text] |
|
| Display text |
setProgressBar(color, [fillType], [rounded]) ⇒ Rank
Rank
Set the progress bar
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Default | Description |
---|---|---|---|
color |
| Color of the progress bar, can be gradient if 2 colors are used | |
[fillType] |
|
| Type of progress bar |
[rounded] |
|
| Rounded corners of the progress bar |
setStatus(presenceStatus) ⇒ Rank
Rank
Set the user presence status
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Description |
---|---|---|
presenceStatus |
| Presence status |
setCreatedTimestamp(timestamp, customDate) ⇒ Rank
Rank
Set the user created timestamp
Kind: global function
Returns: Rank
- The current instance of Rank
Throws:
APIError
If the URL or asset is invalid
Param | Type | Description |
---|---|---|
timestamp |
| Timestamp of when the user joined Discord |
customDate |
| Custom date format for the timestamp |
build([font]) ⇒ Promise.<Buffer>
Promise.<Buffer>
Build the rank card
Kind: global function
Returns: Promise.<Buffer>
- Card image in buffer format
Throws:
APIError
Missing field: data
Param | Type | Default | Description |
---|---|---|---|
[font] |
|
| Font to use in the card |
Last updated