DiscordLua
discorddiscord
v1.2.4
Install

Presence

Class
On this page

Presence 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

Presence.activities

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

Presence.client

# readonly
Name
client
Type
any
Access
readonly
Description
Owning Client instance used for REST, cache, and event dispatch.
Availability
Populated from the Gateway/REST payload or constructor for this Presence.

Presence.clientStatus

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

Presence.guildId

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

Presence.raw

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

Presence.status

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

Presence.user

# readonly
Name
user
Type
any
Access
readonly
Description
User object associated with this Presence.
Availability
Populated from the Gateway/REST payload or constructor for this Presence.

Presence.userId

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

Methods

Presence:equals()

#

Return whether this Presence refers to the same resource as the argument.

Signature

Presence:equals(other)

Parameters

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

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Presence
object:equals(other)

Presence:guild()

#

Performs guild on this Presence. Call it from bot code when you need that operation on the current object.

Signature

Presence:guild()

Parameters

No parameters.

Returns

Presence — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Presence
object:guild()

Presence:member()

#

Performs member on this Presence. Call it from bot code when you need that operation on the current object.

Signature

Presence:member()

Parameters

No parameters.

Returns

Presence — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Presence
object:member()

Presence:set()

#

Performs set on this Presence. Call it from bot code when you need that operation on the current object.

Signature

Presence:set(presence)

Parameters

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

Returns

Presence — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Presence
object:set(presence)

Presence:toJSON()

#

Serialize this Presence into a Lua table suitable for REST or debugging.

Signature

Presence:toJSON()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Presence
object:toJSON()

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