Package arc.discord
Class DiscordRPC
java.lang.Object
arc.discord.DiscordRPC
Simple class for handling Discord Rich Presence.
Implementation based on https://github.com/jagrosh/DiscordIPC
This the only know implementation that is pure Java; on Linux/Mac, this uses Java 16's new Unix sockets.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
static class
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
close()
Attempts to close an open connection to Discord.static void
connect
(long clientId) Call before sending any presence updates.static DiscordRPC.PipeStatus
static void
send
(DiscordRPC.RichPresence presence) Updates the displayed rich presence.static void
Subscribes to all activity events.
-
Field Details
-
onActivityJoin
-
onActivitySpectate
-
onActivityJoinRequest
-
onReady
-
onDisconnected
-
onClose
-
-
Constructor Details
-
DiscordRPC
public DiscordRPC()
-
-
Method Details
-
connect
Call before sending any presence updates.- Throws:
Exception
-
send
Updates the displayed rich presence. -
subscribe
public static void subscribe()Subscribes to all activity events. -
getStatus
-
close
public static void close()Attempts to close an open connection to Discord. Does nothing if not connected.
-