- Documentation
- Client functions
- setDiscordRichPresenceDetails
Function
setDiscordRichPresenceDetails
Sets 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".
Syntax
bool setDiscordRichPresenceDetails(string text)Arguments
textstring- Text up to 128 characters (longer is cut).
""ornil= default text.
Returns
true when the status was passed to the launcher.
Example
addEventHandler("onClientResourceStart", resourceRoot, function()
setDiscordRichPresenceDetails("Roleplay: Los Santos")
setDiscordRichPresenceState("Spaceruje po mieście")
end)
See also
setDiscordRichPresenceStateSets the bottom line of the player's Discord status, usually what they are doing right now (e.g. "Patrolling Idlewood", "On the map: 12/32 players"). It works likesetDiscordRichPresenceDetails: through the launcher, with at most one change every 15 seconds. An empty string restores the default "As nickname".resetDiscordRichPresenceDataClears 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.