Skip to content

Latest commit

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

versionlicense

DiscordIPC

Connect locally to the Discord client using IPC for a subset of RPC features like Rich Presence and Activity Join/Spectate

Features

  • Setting Rich Presence
  • Listen for Join, Spectate, and Join-Request events
  • Detect and specify priority for client build (Stable, PTB, Canary)
  • 100% Java

Getting Started

First you'll need to add this project as a dependency. If you're using maven:

 <dependency>
<groupId>com.jagrosh</groupId>
<artifactId>DiscordIPC</artifactId>
<version>LATEST</version>
</dependency>
 <repository>
<id>central</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>

With gradle:

dependencies {
compile 'com.jagrosh:DiscordIPC:LATEST'
}
repositories {
jcenter()
}

Example

Quick example, assuming you already have a GUI application

IPCClientclient = newIPCClient(345229890980937739L);
client.setListener(newIPCListener(){
@OverridepublicvoidonReady(IPCClientclient)
{
RichPresence.Builderbuilder = newRichPresence.Builder();
builder.setState("West of House")
.setDetails("Frustration level: Over 9000")
.setStartTimestamp(OffsetDateTime.now())
.setLargeImage("canary-large", "Discord Canary")
.setSmallImage("ptb-small", "Discord PTB")
.setParty("party1234", 1, 6)
.setMatchSecret("xyzzy")
.setJoinSecret("join")
.setSpectateSecret("look");
client.sendRichPresence(builder.build());
}
});
client.connect();

Other Examples

Official Discord-RPC Bindings

The official RPC bindings can be found here: https://github.com/discordapp/discord-rpc

A Java wrapper for the official bindings is available here: https://github.com/MinnDevelopment/Java-DiscordRPC

About

Connect locally to the Discord client using IPC for a subset of RPC features like Rich Presence and Activity Join/Spectate

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages