SetPlayerDiscordPresence
setPlayerDiscordPresence
Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.
Server-side only. Part of Discord Rich Presence. See Discord Presence configuration for the optional server-owner resource.
Syntax
local ok, reason = setPlayerDiscordPresence(playerId, {details="My Gothic RP", state="Exploring the Colony"})
Parameters and behavior
playerId: a connected game player ID, numeric integer 1..4294967295. Second argument: the complete flat profile table described in profile fields. First configure the calling resource's Application ID. Replaces all previous fields and claims ownership when unowned; another resource's ownership is rejected. An empty table is a basic Playing activity, not clear.
Returns
Boolean success and empty reason, or false and an error string. True means queued on the server, not visible on Discord. Invalid input/ownership leaves the previous profile unchanged.
Examples, lifecycle and safety
See Discord Rich Presence for complete initialization, location/job updates, field removal, timestamps, counts, buttons and callback examples. Player launcher opt-in is off by default and cannot be overridden. No bot or token is needed; no Discord account identity is returned. Do not forward arbitrary client input to this server API.