Skip to content

Commit f611b37

Browse files
committed
added maven/gradle to readme and updated example
1 parent 3de70f8 commit f611b37

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2017 John A Grosh
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,34 @@ Connect locally to the Discord client using IPC for a subset of RPC features lik
1818
- 100% Java
1919

2020

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+
2149
# Example
2250

2351
Quick example, assuming you already have a GUI application
@@ -27,9 +55,17 @@ client.setListener(new IPCListener(){
2755
@Override
2856
public void onReady(IPCClient client)
2957
{
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());
3369
}
3470
});
3571
client.connect();

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.jagrosh</groupId>
55
<artifactId>DiscordIPC</artifactId>
6-
<version>0.1</version>
6+
<version>0.2</version>
77
<packaging>jar</packaging>
88

99
<dependencies>

0 commit comments

Comments
 (0)