Skip to content

Presence

Implementation of a Discord Presence as a Luau builder.

https://discord.com/developers/docs/events/gateway-events#update-presence

Presence.activities  :: Activity }

An array of activity objects that represent what the client is currently doing.

Presence.since  :: number?

Unix timestamp (in milliseconds) of when the client went idle, or null if the client is not idle.

Presence.afk  :: boolean?

Whether or not the client is afk.

Presence.status  :: string?

The user’s current status. Can be “online”, “dnd”, “idle”, “invisible”, or “offline”.

Presence : addActivity ( activity )  -> Presence

Adds an activity to the presence.

Parameters

activity: JSON

Returns

Presence
Presence : setStatus ( status )  -> Presence

Sets the status of the presence.

Parameters

status: Status

Returns

Presence
Presence : setAfk ( isAfk )  -> Presence

Sets whether the presence is AFK.

Parameters

isAfk: boolean

Returns

Presence
Presence : setSince ( delta )  -> Presence

Sets the time since the presence was last updated.

Parameters

delta: number

Returns

Presence
Presence : build ( )  -> JSON

Builds the presence object that can be sent to the Discord API.

Returns

JSON
Presence . new ( resource )  -> Presence

Constructor for the Discord Presence Builder.

Parameters

resource: {
status: string?,
afk: boolean?,
since: number?,
activities: { activity.JSON,
}

Returns

Presence