Skip to content

User


Properties


User.id : string

The user's Discord id.




User.username : string

The user's Discord username.




User.avatar : string

The user's Discord avatar hash.




User.discriminator : string

The user's Discord discriminator.

Deprecation Notice

This property has been deprecated. Please edit any code that uses it as it will be removed in a later version.




User.bot : boolean

Whether the user is a bot.




User.globalName : string?

the user's display name on Discord.




User.displayName : string?

Deprecation Notice

This property has been deprecated. Please edit any code that uses it as it will be removed in a later version. (Use User.globalName instead)




User.publicFlags : PublicUserFlags

The user's flags.




Methods


User.new(data : dictionary) : User

This method returns a new User object.

Warning

This method is not meant to be called outside of Voyager's internal code.

Parameters




User:getAvatarUrl(size : number?, imageFormat : string?) : string?

This method will return the user's avatar url.

Warning

The size parameter can only be a power of two between 16 and 4096.

Info

If the imageFormat paramiter is left out. It will defualt to .png.

Tip

Use Enum.AvatarImageFormats to fill in the imageFormat parameter.

Parameters

  • size: The desired size the avatar should be.
  • imageFormat: The format the author's avatar should be returned as.




User:hasAnimatedAvatar(): boolean

This method checks whether the user has an animated avatar.