- Documentation
- Discord
Category
Discord
All Lua functions and events in the Discord category, on the server and the client.
Client functions 10
resetClears 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.Discord Rich Presence Data setSwitches 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.Discord Application ID setSets the large image in the player's Discord status and the caption shown when hovering over it. The image is the key (name) of artwork uploaded in the Discord Developer Portal to the application set withDiscord Rich Presence Asset setDiscordApplicationID. Without your own application Trilogy Hub shows its logo. An empty key removes the script-set image.setAdds a link button under the player's Discord status, e.g. "Join our Discord" or "Server website". There can be two buttons (number 1 and 2). Discord shows the buttons to other people viewing the player's profile, not to the player themselves. An empty label removes the button.Discord Rich Presence Button setSets 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".Discord Rich Presence Details setSets the "remaining" timer in the Discord status: Discord counts down to the given moment (e.g. the end of a round). Pass a Unix timestamp in seconds. 0 turns the countdown off.Discord Rich Presence End Time setSets the party size in the Discord status, shown as "(2 of 4)", e.g. the number of people in a team or mission. By default the launcher shows the server's player count; 0, 0 restores that. The size must be at least 1 and no more than the maximum.Discord Rich Presence Party Size setSets the small round image in the corner of the large Discord status image, e.g. a faction or rank icon, with a hover caption. The image must be in the Art Assets of the application set withDiscord Rich Presence Small Asset setDiscordApplicationID. An empty key removes it.setSets the "elapsed" timer in the Discord status: Discord counts time from the given moment (e.g. the start of a mission or a shift). Pass the time as a Unix timestamp in seconds, e.g. fromDiscord Rich Presence Start Time getRealTime().timestamp. 0 restores the timer counting from when the player joined the game.setSets 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 likeDiscord Rich Presence State setDiscordRichPresenceDetails: through the launcher, with at most one change every 15 seconds. An empty string restores the default "As nickname".