Presence
ClassOn 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.
Properties
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
| Name | Type | Required | Behavior |
|---|---|---|---|
other |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
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
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
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
| Name | Type | Required | Behavior |
|---|---|---|---|
presence |
any |
required | Passed through to the implementation as written. |
Returns
Presence — the same instance, for chaining.
Example
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
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.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0