UpdatePlayerDiscordPresence

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

updatePlayerDiscordPresence

Available from 0.1.9. 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 = updatePlayerDiscordPresence(playerId, {state="At the Old Camp", smallImage=false, smallText=false})

Parameters and behavior

Connected numeric game player ID and a flat patch table. Requires an existing profile owned by this resource. Unspecified fields stay unchanged; false removes a field, while nil is absent and cannot remove it. The merged profile is validated atomically, including paired link/party/timestamp constraints. Uses this resource's currently configured Application ID.

Returns

Boolean success and empty reason, or false with an error string (including presence-not-set or presence-owned-by-another-resource). True means queued, not publicly visible. No partial changes on rejection.

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.