ClearPlayerDiscordPresence

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 13:26, 20 October 2026 by QCherry (talk | contribs) (Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

clearPlayerDiscordPresence

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 = clearPlayerDiscordPresence(playerId)

Parameters and behavior

Connected numeric game player ID. Clears the caller's active profile and releases ownership; refuses another resource's profile. Idempotent when no profile is set. No application ID is required to clear. Clear bypasses the normal send delay. Use set, not update, to start a new activity afterward.

Returns

Boolean success and empty reason, or false with player-not-connected / presence-owned-by-another-resource / service-unavailable. Success is not a synchronous Discord-side removal confirmation; after ownership release the former owner gets no cleanup status callback.

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.