Skip to content

User

Represents a user


Properties



Id

A string containing the user's Id.




Username

A string containing the user's username.




AvatarHash

An optional string containing the user's avatar hash.




IsBot

A boolean representing whether the user is a bot.




Mention

A string that mentions this user.




GlobalName

An optional string containing the user's display name.




PublicFlags

A PublicUserFlags instance representing the user's flags.




Constructors



new(data)

Constructs a new User instance from a user object. Returns a new User instance.

Internal Code warning

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

Parameters




Methods



GetAvatarUrl(size, imageFormat)

Returns an optional string containing the user's avatar url.

Warning

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

If the user has no avatar, this will return nil.

Default Parameter Values

imageFormat: .png

Tip

Use the ImageFormat enum to fill in the imageFormat parameter.

Parameters

  • size : number? - The desired size of the user's avatar url.
  • imageFormat : string? - The desired image format of the user's avatar url.




HasAnimatedAvatar()

Returns a boolean representing whether the user's avatar is animated.