@@ -18,6 +18,34 @@ Connect locally to the Discord client using IPC for a subset of RPC features lik
18
18
- 100% Java
19
19
20
20
21
+ # Getting Started
22
+
23
+ First you'll need to add this project as a dependency. If you're using maven:
24
+ ``` xml
25
+ <dependency >
26
+ <groupId >com.jagrosh</groupId >
27
+ <artifactId >DiscordIPC</artifactId >
28
+ <version >LATEST</version >
29
+ </dependency >
30
+ ```
31
+ ``` xml
32
+ <repository >
33
+ <id >central</id >
34
+ <name >bintray</name >
35
+ <url >http://jcenter.bintray.com</url >
36
+ </repository >
37
+ ```
38
+ With gradle:
39
+ ``` groovy
40
+ dependencies {
41
+ compile 'com.jagrosh:DiscordIPC:LATEST'
42
+ }
43
+
44
+ repositories {
45
+ jcenter()
46
+ }
47
+ ```
48
+
21
49
# Example
22
50
23
51
Quick example, assuming you already have a GUI application
@@ -27,9 +55,17 @@ client.setListener(new IPCListener(){
27
55
@Override
28
56
public void onReady (IPCClient client )
29
57
{
30
- client. sendRichPresence(new RichPresence (" West of House" , " Frustration level: Over 9000" ,
31
- OffsetDateTime . now(), null , " canary-large" , null , " ptb-small" , null , " party1234" ,
32
- 1 , 6 , " xyzzy" , " join" , " look" , false ));
58
+ RichPresence . Builder builder = new RichPresence .Builder ();
59
+ builder. setState(" West of House" )
60
+ .setDetails(" Frustration level: Over 9000" )
61
+ .setStartTimestamp(OffsetDateTime . now())
62
+ .setLargeImage(" canary-large" , " Discord Canary" )
63
+ .setSmallImage(" ptb-small" , " Discord PTB" )
64
+ .setParty(" party1234" , 1 , 6 )
65
+ .setMatchSecret(" xyzzy" )
66
+ .setJoinSecret(" join" )
67
+ .setSpectateSecret(" look" );
68
+ client. sendRichPresence(builder. build());
33
69
}
34
70
});
35
71
client. connect();
0 commit comments