Advertisement
Guest User

DiscordRPC

a guest
Nov 18th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. DiscordRPC lib = DiscordRPC.INSTANCE;
  2.         String id = "<VOTRE CLIENT-ID>";
  3.         String steamID = "";
  4.         DiscordEventHandlers handlers = new DiscordEventHandlers();
  5.         lib.Discord_Initialize(id, handlers, true, steamID);
  6.         DiscordRichPresence presence = new DiscordRichPresence();
  7.         presence.startTimestamp = System.currentTimeMillis() / 1000;
  8.         presence.details = "<VOTRE DETAILS>";
  9.         presence.state = "<VOTRE STATE>";
  10.         lib.Discord_UpdatePresence(presence);
  11.  
  12.         new Thread(() -> {
  13.             while (!Thread.currentThread().isInterrupted()){
  14.                 lib.Discord_RunCallbacks();
  15.                 try {
  16.                     Thread.sleep(2000);
  17.                 }catch (InterruptedException ignored){}
  18.             }
  19.         }, "RPC-Callback-Handler").start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement