Skip to content

User

Implementation of the Discord User class in Luau

https://discord.com/developers/docs/resources/user#user-object

Properties

id

User.id  :: string

The unique identifier for this user.

username

User.username  :: string

The username of this user.

discriminator

User.discriminator  :: string?

The discriminator of this user, used to distinguish between users with the same username.

globalName

User.globalName  :: string?

The global display name of this user, if they have one set.

avatar

User.avatar  :: string?

The avatar hash of this user.

avatarDecoration

User.avatarDecoration  :: Classes.AvatarDecoration?

The avatar decoration of this user, if they have one.

bot

User.bot  :: boolean?

Whether this user is a bot account.

system

User.system  :: boolean?

Whether this user is a system account.

mfaEnabled

User.mfaEnabled  :: boolean?

Whether this user has two-factor authentication enabled.

locale

User.locale  :: string?

The user’s preferred language.

verified

User.verified  :: boolean?

Whether this user’s email is verified.

User.banner  :: string?

email

User.email  :: string?

The user’s email address.

flags

User.flags  :: Classes.UserBitflag?

The flags that indicate various properties and states of the user.

premiumType

User.premiumType  :: apiTypes.PremiumType?

The type of Nitro subscription this user has.

publicFlags

User.publicFlags  :: Classes.UserBitflag?

The public flags that indicate various properties and states of the user.

accentColor

User.accentColor  :: number?

The user’s custom profile accent color.

Methods

The User instance has no set methods!

Functions

sync

User . sync (

     self: User
     userData: apiTypes.UserObject
)  -> ()

Responsible for syncing data to this webhook object. This is typically called by the API when this object is created or updated.

new

User . new (

     userData: apiTypes.UserObject
)  -> ()

Responsible for constructing this class.