ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. setDiscordRichPresenceDetails

Function

setDiscordRichPresenceDetails

ClientDiscordTrilogy Hub only

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). "" or nil = 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