DiscordLua
discorddiscord
v1.2.4
Install

ClientUser

Class
On this page

ClientUser is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.

class Module 1.2.4 Source

Properties

ClientUser.avatarDecorationData

# readonly
Name
avatarDecorationData
Type
any
Access
readonly
Description
Instance field ClientUser.avatarDecorationData. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this ClientUser.

ClientUser.collectibles

# readonly
Name
collectibles
Type
any
Access
readonly
Description
Instance field ClientUser.collectibles. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this ClientUser.

ClientUser.mfaEnabled

# readonly
Name
mfaEnabled
Type
any
Access
readonly
Description
Instance field ClientUser.mfaEnabled. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this ClientUser.

ClientUser.presence

# mutable
Name
presence
Type
any
Access
mutable
Description
Instance field ClientUser.presence. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this ClientUser.

ClientUser.verified

# readonly
Name
verified
Type
any
Access
readonly
Description
Instance field ClientUser.verified. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this ClientUser.

Methods

ClientUser:edit()

#

Apply a REST update to this resource.

Signature

ClientUser:edit(options)

Parameters

NameTypeRequiredBehavior
options table optional Lua option table. Field names match the corresponding DiscordLua option type when one exists.

Returns

ClientUser — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ClientUser
object:edit({})

ClientUser:setActivity()

#

Set the Activity field. Builders return this ClientUser so setters can be chained.

Signature

ClientUser:setActivity(name, typeValue)

Parameters

NameTypeRequiredBehavior
name any required Passed through to the implementation as written.
typeValue any required Passed through to the implementation as written.

Returns

ClientUser — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ClientUser
object:setActivity(name, typeValue)

ClientUser:setAFK()

#

Set the AFK field. Builders return this ClientUser so setters can be chained.

Signature

ClientUser:setAFK(afk)

Parameters

NameTypeRequiredBehavior
afk any required Passed through to the implementation as written.

Returns

ClientUser — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ClientUser
object:setAFK(afk)

ClientUser:setAvatar()

#

Set the Avatar field. Builders return this ClientUser so setters can be chained.

Signature

ClientUser:setAvatar(avatar)

Parameters

NameTypeRequiredBehavior
avatar any required Passed through to the implementation as written.

Returns

ClientUser — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ClientUser
object:setAvatar(avatar)

ClientUser:setBanner()

#

Set the Banner field. Builders return this ClientUser so setters can be chained.

Signature

ClientUser:setBanner(banner)

Parameters

NameTypeRequiredBehavior
banner any required Passed through to the implementation as written.

Returns

ClientUser — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ClientUser
object:setBanner(banner)

ClientUser:setPresence()

#

Set the Presence field. Builders return this ClientUser so setters can be chained.

Signature

ClientUser:setPresence(presence)

Parameters

NameTypeRequiredBehavior
presence any required Passed through to the implementation as written.

Returns

ClientUser — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ClientUser
object:setPresence(presence)

ClientUser:setStatus()

#

Set the Status field. Builders return this ClientUser so setters can be chained.

Signature

ClientUser:setStatus(status)

Parameters

NameTypeRequiredBehavior
status any required Passed through to the implementation as written.

Returns

ClientUser — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ClientUser
object:setStatus(status)

ClientUser:setUsername()

#

Set the Username field. Builders return this ClientUser so setters can be chained.

Signature

ClientUser:setUsername(username)

Parameters

NameTypeRequiredBehavior
username any required Passed through to the implementation as written.

Returns

ClientUser — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a ClientUser
object:setUsername(username)

Examples

Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc