8adf0ad03692068d8b10e19a6f8e40cf1640b446
Installation
- Follow the steps at https://docs.discord.com/developers/discord-social-sdk/getting-started
- Download the Discord Social SDK Standalone
- Add the DISCORD_SDK environment variable
export DISCORD_SDK=<path-to-discord-sdk> - Clone this repo and compile the libraries
git clone https://github.com/zxrotwo002/java-discord-sdk-wrapper
cd java-discord-sdk-wrapper
./export.sh
- Add the compiled libraries in out/lib to your system libraries or wherever your java application can access them:
sudo cp out/lib/libdiscord_partner_sdk.so /usr/lib
sudo cp out/lib/libdiscord_bridge.so /usr/lib
- Add the
DiscordLib.jarto your project - Initialize the Discord Social SDK
DiscordBridge bridge = new DiscordBridge();
bridge.init(<Your Discord Application ID found in the Developer Portal>);
bridge.setAdapter(<Add the DiscordBridgeAdapter interface if you want to receive possible error messages from the Library>);
bridge.start();
- Send activity updates
DiscordActivity activity = new DiscordActivityBuilder()
.name("Some name")
...
.build;
- Keep your application alive with a
while(true)or similar
Description
Languages
Java
56.8%
C++
40.5%
Shell
2.7%