This class provides static methods to interact with the Discord RPC (Rich Presence) API. It facilitates integration with Discord's rich presence functionality, enabling applications to display real-time information about the user's status. Methods are available for initializing the API, updating presence, handling callbacks, and managing connection settings.

Static variables

@:native("DISCORD_RPC_VERSION")staticRPC_VERSION:Int

Version of the rich presence.

Static methods

@:native("Discord_ClearPresence")staticClearPresence():Void

Clears the current presence.

@:native("Discord_Initialize")staticInitialize(applicationId:ConstCharStar, handlers:RawPointer<DiscordEventHandlers>, autoRegister:Bool, optionalSteamId:ConstCharStar):Void

Initializes the Discord RPC.

Parameters:

applicationId

The application ID for the Discord app.

handlers

Pointer to a DiscordEventHandlers struct containing event callbacks.

autoRegister

Indicates whether to automatically register the application to Steam.

optionalSteamId

Optional Steam ID if using Steam.

@:native("Discord_Register")staticRegister(applicationId:ConstCharStar, command:ConstCharStar):Void

Registers the application.

Parameters:

applicationId

The application ID for the Discord app.

command

The command to register.

@:native("Discord_RegisterSteamGame")staticRegisterSteamGame(applicationId:ConstCharStar, steamId:ConstCharStar):Void

Registers a Steam game.

Parameters:

applicationId

The application ID for the Discord app.

steamId

The Steam ID for the game.

@:native("Discord_Respond")staticRespond(userid:ConstCharStar, reply:DiscordActivityJoinRequestReply):Void

Responds to a user's request.

Parameters:

userid

The user ID to respond to.

reply

The reply type.

@:native("Discord_RunCallbacks")staticRunCallbacks():Void

Checks for incoming messages and dispatches callbacks.

@:native("Discord_Shutdown")staticShutdown():Void

Shuts down the Discord RPC.

@:native("Discord_UpdateHandlers")staticUpdateHandlers(handlers:RawPointer<DiscordEventHandlers>):Void

Updates the event handlers.

Parameters:

handlers

Pointer to a DiscordEventHandlers struct containing event callbacks.

@:native("Discord_UpdatePresence")staticUpdatePresence(presence:RawConstPointer<DiscordRichPresence>):Void

Updates the current presence.

Parameters:

presence

Pointer to a DiscordRichPresence struct containing the presence information.