OnPlayerDiscordPresenceStatus
onPlayerDiscordPresenceStatus
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 diagnostic event, delivered to the resource currently owning a player's active Discord Rich Presence profile. No addEvent declaration is needed.
Signature
addEventHandler("onPlayerDiscordPresenceStatus", root, function(playerId, status)
outputDebugString("Discord player " .. tostring(playerId) .. ": " .. status)
end)
playerId is the numeric game player ID; status is a string. Delivery occurs on diagnostic changes to the current owner, deferred by the server, not synchronously inside set/update.
See all status values. After clear there is no owner and no former-owner cleanup callback. Not every possible status is guaranteed to be emitted. The getter also returns disconnected for invalid/offline players; use onPlayerQuit for quit handling.
Advisory client diagnostics, never authorization. Applied means local Discord RPC acknowledgement, not proof of identity, guild membership, roles, public display or valid gameplay. Do not grant rewards/permissions based on it. No Discord account ID, token, username or friends list is passed. getPlayerDiscordPresenceStatus can read the last status; it may lag a clear until the next client report.