• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

version license

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

IPCClient client = new IPCClient(345229890980937739L);
client.setListener(new IPCListener(){
    @Override
    public void onReady(IPCClient client)
    {
        RichPresence.Builder builder = new RichPresence.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

More Repositories

1

MusicBot

🎢 A Discord music bot that's easy to set up and run yourself!
Java
4,935
star
2

GiveawayBot

πŸŽ‰ Hold giveaways quickly and easily on your Discord server!
Java
614
star
3

Vortex

πŸŒ€ Discord Moderation Bot
Java
553
star
4

Spectra

Spectra is a multi-purpose, for-fun and for-utility Discord bot!
Java
110
star
5

Selfbot

A simple Discord selfbot that is fast and easy to set up and use
Java
99
star
6

FrostCleverbot

πŸ’¬ An extremely simple Discord cleverbot
Python
85
star
7

Phoenix

πŸ”₯ Discord autoreply bot using DialogFlow
Ruby
66
star
8

JLyrics

🎼 Expandable lyrics-scraping API for Java
Java
58
star
9

JagTag

πŸ“ JagTag is a simple - yet powerful and customizable - interpretted text parsing language!
Java
41
star
10

WheresTheParty

🎊 Discord HackWeek 2019 🎊 See where people are talking all over Discord!
Java
38
star
11

ExampleBot

A bot showcasing the JDA-Utilities library
Java
36
star
12

jagrosh.github.io

🌐 My website!
HTML
28
star
13

EasySQL

Manage SQL Tables in H2 with less code and no annotations
Java
18
star
14

Pi-Calculator

Just run this forever and you'll eventually calculate pi
Python
14
star
15

DiscordInteractions

REST-only Discord Interactions implementation
Java
13
star
16

DialogflowBot

Discord Bot to provide responses from Dialogflow
Java
10
star
17

Blog

πŸ“– My blog!
10
star
18

DiscordList

The hot new listing site for discord
9
star
19

Jammi

Just Another Multi Media Interface
Java
6
star
20

Miasma

5
star
21

RoleDistributionBot

Discord bot to distribute roles based on account creation epoch
Java
5
star