Discord integration functions. More...
Public Member Functions | |
| integer | Init (string applicationID) |
| Initializes Discord integration. | |
| void | UpdateRichPresence (string details, string state, string largeImageKey, string smallImageKey) |
| Updates Discord Rich Presence. | |
| void | UpdateRichPresence (string details, string state, string largeImageKey, integer startTime) |
| Updates Discord Rich Presence. | |
| void | UpdateRichPresence (string details, string state, string largeImageKey, string smallImageKey, integer startTime) |
| Updates Discord Rich Presence. | |
| void | SetActivityDetails (string details) |
| Sets the first line of text of the activity. | |
| void | SetActivityState (string details) |
| Sets the second line of text of the activity. | |
| void | SetActivityLargeImage (string largeImageKey, string largeImageText) |
| Sets the image (and optionally) the hover text of the large image asset. | |
| void | SetActivitySmallImage (string smallImageKey, string smallImageText) |
| Sets the image (and optionally) the hover text of the small image asset. | |
| void | SetActivityElapsedTimer (integer timestamp) |
| Sets the elapsed timer of the activity. | |
| void | SetActivityRemainingTimer (integer timestamp) |
| Sets the remaining timer of the activity. | |
| void | SetActivityPartySize (integer currentSize, integer maxSize) |
| Sets the current party size (and optionally) the max party size of the activity. | |
| void | UpdateActivity (string details) |
| Updates the user's presence. | |
| string | GetCurrentUsername () |
| Gets the current user's username. | |
| string | GetCurrentUserID () |
| Gets the current user's ID. | |
| void | GetCurrentUserAvatar (integer size, function callback) |
| Gets the current user's avatar. | |
Discord integration functions.
They require the Game SDK library to be present.
| void API.Discord.GetCurrentUserAvatar | ( | integer | size, |
| function | callback ) |
Gets the current user's avatar.
The callback function must have two parameters: responseCode and image. responseCode receives the API response code, and image receives an Image if the operation succeeded, or null if it failed. The integration must have been initialized with API.Discord.Init before calling this.
| size | The size of the avatar to fetch. Must be one of: 16, 32, 64, 128, 256, 512, 1024 |
| callback | The callback to execute. |
| string API.Discord.GetCurrentUserID | ( | ) |
Gets the current user's ID.
This returns null if the integration hasn't received the user's information yet. The integration must have been initialized with API.Discord.Init before calling this.
| string API.Discord.GetCurrentUsername | ( | ) |
Gets the current user's username.
This returns null if the integration hasn't received the user's information yet. The integration must have been initialized with API.Discord.Init before calling this.
| integer API.Discord.Init | ( | string | applicationID | ) |
Initializes Discord integration.
| applicationID | The Discord Application ID. This will have needed to be created via the Discord Developer Portal. |
| void API.Discord.SetActivityDetails | ( | string | details | ) |
Sets the first line of text of the activity.
This doesn't update the user's presence; you must call API.Discord.UpdateActivity. The integration must have been initialized with API.Discord.Init before calling this.
| details | The first line of text in the Rich Presence. |
| void API.Discord.SetActivityElapsedTimer | ( | integer | timestamp | ) |
Sets the elapsed timer of the activity.
This doesn't update the user's presence; you must call API.Discord.UpdateActivity. The integration must have been initialized with API.Discord.Init before calling this.
| timestamp | A Unix timestamp of when the timer started. If 0, the timer is disabled. |
| void API.Discord.SetActivityLargeImage | ( | string | largeImageKey, |
| string | largeImageText ) |
Sets the image (and optionally) the hover text of the large image asset.
This doesn't update the user's presence; you must call API.Discord.UpdateActivity. The integration must have been initialized with API.Discord.Init before calling this.
| largeImageKey | The internal name of the large image asset to display, created via the Discord Developer Portal. |
| largeImageText | The hover text of the large image. |
| void API.Discord.SetActivityPartySize | ( | integer | currentSize, |
| integer | maxSize ) |
Sets the current party size (and optionally) the max party size of the activity.
This doesn't update the user's presence; you must call API.Discord.UpdateActivity. The integration must have been initialized with API.Discord.Init before calling this.
| currentSize | The current size of the party. |
| maxSize | The max size of the party. |
| void API.Discord.SetActivityRemainingTimer | ( | integer | timestamp | ) |
Sets the remaining timer of the activity.
This doesn't update the user's presence; you must call API.Discord.UpdateActivity. The integration must have been initialized with API.Discord.Init before calling this.
| timestamp | A Unix timestamp of when the timer will end. If 0, the timer is disabled. |
| void API.Discord.SetActivitySmallImage | ( | string | smallImageKey, |
| string | smallImageText ) |
Sets the image (and optionally) the hover text of the small image asset.
This doesn't update the user's presence; you must call API.Discord.UpdateActivity. The integration must have been initialized with API.Discord.Init before calling this.
| smallImageKey | The internal name of the small image asset to display, created via the Discord Developer Portal. |
| smallImageText | The hover text of the small image. |
| void API.Discord.SetActivityState | ( | string | details | ) |
Sets the second line of text of the activity.
This doesn't update the user's presence; you must call API.Discord.UpdateActivity. The integration must have been initialized with API.Discord.Init before calling this.
| details | The second line of text, appearing below details. |
| void API.Discord.UpdateActivity | ( | string | details | ) |
Updates the user's presence.
The integration must have been initialized with API.Discord.Init before calling this.
| details | The first line of text in the Rich Presence. |
| void API.Discord.UpdateRichPresence | ( | string | details, |
| string | state, | ||
| string | largeImageKey, | ||
| integer | startTime ) |
Updates Discord Rich Presence.
The integration must have been initialized with API.Discord.Init before calling this.
| details | The first line of text in the Rich Presence. |
| state | The second line of text, appearing below details. |
| largeImageKey | The internal name of the large image asset to display, created via the Discord Developer Portal. |
| startTime | A Unix timestamp of when the activity started. If 0, the timer is disabled. |
| void API.Discord.UpdateRichPresence | ( | string | details, |
| string | state, | ||
| string | largeImageKey, | ||
| string | smallImageKey ) |
Updates Discord Rich Presence.
The integration must have been initialized with API.Discord.Init before calling this.
| details | The first line of text in the Rich Presence. |
| state | The second line of text, appearing below details. |
| largeImageKey | The internal name of the large image asset to display, created via the Discord Developer Portal. |
| smallImageKey | The internal name of the small image asset to display, also created via the Discord Developer Portal. |
| void API.Discord.UpdateRichPresence | ( | string | details, |
| string | state, | ||
| string | largeImageKey, | ||
| string | smallImageKey, | ||
| integer | startTime ) |
Updates Discord Rich Presence.
The integration must have been initialized with API.Discord.Init before calling this.
| details | The first line of text in the Rich Presence. |
| state | The second line of text, appearing below details. |
| largeImageKey | The internal name of the large image asset to display, created via the Discord Developer Portal. |
| smallImageKey | The internal name of the small image asset to display, also created via the Discord Developer Portal. |
| startTime | A Unix timestamp of when the activity started. If 0, the timer is disabled. |