Presence
Implementation of a Discord Presence as a Luau builder.
https://discord.com/developers/docs/events/gateway-events#update-presence
Summary
Properties
Presence.activities :: { Classes.Activity }Presence.since :: number?Presence.afk :: boolean?Presence.status :: string?Properties
Section titled “Properties”activities
Section titled “activities”An array of activity objects that represent what the client is currently doing.
Unix timestamp (in milliseconds) of when the client went idle, or null if the client is not idle.
Whether or not the client is afk.
status
Section titled “status”The user’s current status. Can be “online”, “dnd”, “idle”, “invisible”, or “offline”.
Methods
Section titled “Methods”addActivity
Section titled “addActivity”Presence : addActivity ( activity ) -> Presence
Adds an activity to the presence.
Parameters
| activity: JSON |
Returns
| Presence |
setStatus
Section titled “setStatus”Presence : setStatus ( status ) -> Presence
Sets the status of the presence.
Parameters
| status: Status |
Returns
| Presence |
setAfk
Section titled “setAfk”Presence : setAfk ( isAfk ) -> Presence
Sets whether the presence is AFK.
Parameters
| isAfk: boolean |
Returns
| Presence |
setSince
Section titled “setSince”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 |
Functions
Section titled “Functions”Presence . new ( resource ) -> Presence
Constructor for the Discord Presence Builder.
Parameters
| resource: { status: string?, afk: boolean?, since: number?, activities: { activity.JSON, } |
Returns
| Presence |