- Documentation
- Client functions
- resetDiscordRichPresenceData
Function
resetDiscordRichPresenceData
Clears everything scripts have set in the player's Discord status (texts, images, times, party, buttons, own application) and restores the default Trilogy Hub status: "Playing on: server name / As nickname". The status is also cleared automatically when the player connects, disconnects or leaves.
Syntax
bool resetDiscordRichPresenceData()Returns
true on success.
Example
addEventHandler("onClientResourceStop", resourceRoot, function()
resetDiscordRichPresenceData()
end)
See also
setDiscordRichPresenceDetailsSets the top line of the player's Discord "Playing" status (rich presence), e.g. "On police duty" or "Race: Grove Street". The status is shown by the Trilogy Hub launcher, so it works when the player has the Discord app running on their computer. Changes reach Discord at most once every 15 seconds (Discord's limit), so more frequent calls are merged and the latest value is shown. An empty string restores the default text "Playing on: server name".setDiscordApplicationIDSwitches the player's Discord status to your server's own Discord application (the Application ID from the Discord Developer Portal). The status then shows your server's name instead of "Trilogy Hub", and you can use your own images from that application's Rich Presence → Art Assets tab. Changing the application requires reconnecting to Discord, so previously set images are cleared. An empty string goes back to the Trilogy Hub application.