Discord RPC / Rich Presence bindings/wrapper for C#
Using SharpPresence is not unlike using the official C SDK. Simply either compile & add reference to the library in your project, or add the file "Discord.cs".
EventHandlers
RichPresence
string
) - the 'state' section of the rich game datastring
) - the 'details' section of the rich game dataInt64
) - the time at which the game startedInt64
) - the time at which the game will endstring
) - the large imagestring
) - the large image tooltipstring
) - the small imagestring
) - the small image tooltipstring
) - the party IDint
) - the number of players in the partyint
) - the maximum number of players in the partystring
) - the match IDstring
) - the match join IDstring
) - the match spectate IDsbyte
) - whether or not the game is a sessionJoinRequest
This structure contains:
string
): the ID of the user requesting to joinstring
): the username of the user requesting to joinstring
): the avatar of the user requesting to joinInitialize(...)
This function takes the form of Discord.Initialize(string, EventHandlers)
. It is simply a wrapper for Discord_Initialize(...)
and handles references, among other details. Currently it does not support the optionalSteamId
parameter, however it can easily be modified to allow for customizability.
UpdatePresence(...)
This function takes the form of Discord.UpdatePresence(RichPresence)
. It handles pointers and memory allocation to wrap Discord_UpdatePresence(...)
very nicely and help to make code much more readable.
Shutdown()
Does nothing special. Simply wraps the function Discord_Shutdown()
within the OOP-focused layout.
UpdateConnection()
Does nothing special. Simply wraps the function Discord_UpdateConnection()
within the OOP-focused layout.
RunCallbacks()
Does nothing special. Simply wraps the function Discord_RunCallbacks()
within the OOP-focused layout.
Respond()
Does nothing special. Simply wraps the function Discord_Respond()
within the OOP-focused layout.
Reply
The three states recieved from a game after a join request has been sent.