public interface DiscordRPC
extends com.sun.jna.Library
INSTANCE to access this library.
| Modifier and Type | Field and Description |
|---|---|
static int |
DISCORD_REPLY_IGNORE
Currently unsused response, treated like NO.
|
static int |
DISCORD_REPLY_NO
Used to decline a request via
Discord_Respond(String, int) |
static int |
DISCORD_REPLY_YES
Used to accept a request via
Discord_Respond(String, int) |
static DiscordRPC |
INSTANCE
Library instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Discord_ClearPresence()
Clears the currently set presence.
|
void |
Discord_Initialize(@NotNull java.lang.String applicationId,
@Nullable DiscordEventHandlers handlers,
boolean autoRegister,
@Nullable java.lang.String steamId)
Initializes the library, supply with application details and event handlers.
|
void |
Discord_Register(java.lang.String applicationId,
java.lang.String command)
Registers the given application so it can be run by the discord client.
|
void |
Discord_RegisterSteamGame(java.lang.String applicationId,
java.lang.String steamId)
Similar to
Discord_Register(String, String) but uses the steam
game's installation path. |
void |
Discord_Respond(@NotNull java.lang.String userid,
int reply)
Responds to the given user with the specified reply type.
|
void |
Discord_RunCallbacks()
Executes the registered handlers for currently queued events.
|
void |
Discord_Shutdown()
Shuts the RPC connection down.
|
void |
Discord_UpdateConnection()
Polls events from the RPC pipe and pushes the currently queued presence.
|
void |
Discord_UpdateHandlers(@Nullable DiscordEventHandlers handlers)
Updates the registered event handlers to the provided struct.
|
void |
Discord_UpdatePresence(@Nullable DiscordRichPresence struct)
Updates the currently set presence of the logged in user.
|
static final DiscordRPC INSTANCE
static final int DISCORD_REPLY_NO
Discord_Respond(String, int)DISCORD_REPLY_YES,
Constant Field Valuesstatic final int DISCORD_REPLY_YES
Discord_Respond(String, int)DISCORD_REPLY_NO,
Constant Field Valuesstatic final int DISCORD_REPLY_IGNORE
Discord_Respond(String, int)DISCORD_REPLY_NO,
Constant Field Valuesvoid Discord_Initialize(@NotNull
@NotNull java.lang.String applicationId,
@Nullable
@Nullable DiscordEventHandlers handlers,
boolean autoRegister,
@Nullable
@Nullable java.lang.String steamId)
Discord_RunCallbacks() method is invoked!
Discord_Shutdown()applicationId - The ID for this RPC application,
retrieved from the developer dashboardhandlers - Nullable instance of DiscordEventHandlersautoRegister - true to automatically call Discord_RegisterSteamGame(String, String) or Discord_Register(String, String)steamId - Possible steam ID of the running gamevoid Discord_Shutdown()
void Discord_RunCallbacks()
It is recommended to call this in a 2 second interval
void Discord_UpdateConnection()
If the IO-Thread has been enabled this will not be supported!
void Discord_UpdatePresence(@Nullable
@Nullable DiscordRichPresence struct)
struct - The new presence to useDiscordRichPresencevoid Discord_ClearPresence()
void Discord_Respond(@NotNull
@NotNull java.lang.String userid,
int reply)
userid - The id of the user to respond toreply - The reply typeDiscordUser.userIdvoid Discord_UpdateHandlers(@Nullable
@Nullable DiscordEventHandlers handlers)
handlers - The handlers to update to, or nullvoid Discord_Register(java.lang.String applicationId,
java.lang.String command)
discord-<appid>://applicationId - The ID of the application to registercommand - The command for the application startup, or null to use the
current executable's pathvoid Discord_RegisterSteamGame(java.lang.String applicationId,
java.lang.String steamId)
Discord_Register(String, String) but uses the steam
game's installation path.applicationId - The ID of the application to registersteamId - The steam ID for the game