Entity Info
userAvatarDecoration
$userAvatarDecoration
The $userAvatarDecoration function returns the URL of the avatar decoration (the frame drawn around the avatar) of a user. It is ready to use: no need to build the CDN URL from a hash. This function does not exist in BibiScript: it is specific to Bot Creator.
Syntax
$userAvatarDecoration[userID;(format)]
Parameters
| Parameter | Description |
|---|---|
userID |
Required - The ID of the user (digits only, greater than 0). Otherwise Invalid user ID. is raised. |
format |
Optional - png or webp. Empty or absent: png. Another value raises Invalid image format. |
Return Value
- Type: String (URL) or empty string
- The URL of the decoration image.
- An empty string if the user has no avatar decoration.
Examples
Tell whether a user has a decoration
$if[$userAvatarDecoration[$authorID]!=]
$sendMessage[You wear an avatar decoration.]
$else
$sendMessage[No avatar decoration.]
$endif
Notes
- Animated decorations are animated PNG images. For the decoration of the server profile, use
$userServerAvatarDecoration. - Errors:
Invalid user ID.andUser not found. - In a JavaScript bot (discord.js):
user.avatarDecorationURL(),nullwhen there is none.
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.