UpdatePlayerDiscordPresence: Difference between revisions
Document upcoming 0.1.9 Discord Rich Presence: server Lua functions, callback, opt-in and owner setup; not a release |
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits |
||
| Line 1: | Line 1: | ||
= updatePlayerDiscordPresence = | = updatePlayerDiscordPresence = | ||
'''Available from 0.1.9 | '''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. | '''Server-side only.''' Part of [[Discord Rich Presence]]. See [[Discord Presence configuration]] for the optional server-owner resource. | ||
Latest revision as of 13:30, 20 October 2026
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.