{"id":26566469,"url":"https://github.com/jncrmx/discord-game-sdk4j","last_synced_at":"2025-04-05T20:01:52.875Z","repository":{"id":36997723,"uuid":"255076639","full_name":"JnCrMx/discord-game-sdk4j","owner":"JnCrMx","description":"Java bindings for Discord's Game SDK","archived":false,"fork":false,"pushed_at":"2025-03-02T16:36:57.000Z","size":372,"stargazers_count":129,"open_issues_count":12,"forks_count":25,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T19:01:11.365Z","etag":null,"topics":["bindings","discord","discord-gamesdk","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JnCrMx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"jcm333"}},"created_at":"2020-04-12T12:22:50.000Z","updated_at":"2025-03-26T17:15:50.000Z","dependencies_parsed_at":"2024-05-29T20:33:49.644Z","dependency_job_id":"a7ee65e7-1c52-4f9d-88e2-90e22d18d624","html_url":"https://github.com/JnCrMx/discord-game-sdk4j","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JnCrMx%2Fdiscord-game-sdk4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JnCrMx%2Fdiscord-game-sdk4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JnCrMx%2Fdiscord-game-sdk4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JnCrMx%2Fdiscord-game-sdk4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JnCrMx","download_url":"https://codeload.github.com/JnCrMx/discord-game-sdk4j/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393547,"owners_count":20931811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","discord","discord-gamesdk","java"],"created_at":"2025-03-22T18:33:57.397Z","updated_at":"2025-04-05T20:01:52.834Z","avatar_url":"https://github.com/JnCrMx.png","language":"Java","funding_links":["https://ko-fi.com/jcm333"],"categories":[],"sub_categories":[],"readme":"# discord-game-sdk4j\n\n[![](https://jitpack.io/v/JnCrMx/discord-game-sdk4j.svg)](https://jitpack.io/#JnCrMx/discord-game-sdk4j)\n[![](https://img.shields.io/badge/JavaDoc-latest-4c1)](https://docs.jcm.re/discord-game-sdk4j/)\n\n\nThis project provides Java bindings for the\n[Discord GameSDK](https://discordapp.com/developers/docs/game-sdk/sdk-starter-guide).\n\nTo be honest I'm not sure if people even need this, because Discord apparently discarded its game store idea.\n\nBut maybe the activity, overlay, user, and relationship features could be useful to some people.\n\n## Rich Presence\n\nIf you are just looking for an alternative to the deprecated [Discord Rich Presence SDK](https://discord.com/developers/docs/rich-presence/how-to),\nhead over to the [ActivityExample.java](examples/ActivityExample.java)!\n\n## Features of the SDK\n\n**Some of the features are deprecated by Discord as of Wed, 09 Nov 2022 and will be decommissioned and stop working on Tuesday May 2, 2023.\nThey are marked with :broken_heart: in the table.\nThose already implemented will most likely continue to work until Discord decommissions them.\nThose not implemented will remains such, as putting work into features which will end working in less than a year does not seem worth it to me.**\n\n**The Java-only implementation currently does not support all features fully.\nI am aiming to fully implement all non-deprecated features soon.**\n\n| Feature                                                                     | State                                      | Example                                                                                                                                  |\n|-----------------------------------------------------------------------------|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [Achievements](https://discord.com/developers/docs/game-sdk/achievements)   | 🔴 💔 not implemented                      |                                                                                                                                          |\n| [Activities](https://discord.com/developers/docs/game-sdk/activities)       | 🟡 ❤️ partially implemented[^activities]   | [ActivityExample.java](examples/ActivityExample.java)                                                                                    |\n| [Applications](https://discord.com/developers/docs/game-sdk/applications)   | 🟡 💔 partially implemented[^applications] |                                                                                                                                          |\n| [Voice](https://discord.com/developers/docs/game-sdk/discord-voice)         | 🟢 💔 implemented                          |                                                                                                                                          |\n| [Images](https://discord.com/developers/docs/game-sdk/images)               | 🟢 💔 implemented                          | none yet :cry: (see [``imageTest()``](src/test/java/de/jcm/discordgamesdk/DiscordTest.java#L417) for now)                                |\n| [Lobbies](https://discord.com/developers/docs/game-sdk/lobbies)             | 🔴 💔 not implemented                      |                                                                                                                                          |\n| [Networking](https://discord.com/developers/docs/game-sdk/networking)       | 🔴 💔 not implemented                      |                                                                                                                                          |\n| [Overlay](https://discord.com/developers/docs/game-sdk/overlay)             | 🟢 ❤️ implemented                          | none yet :cry: (see [``overlayTest()``](src/test/java/de/jcm/discordgamesdk/DiscordTest.java#L289) for now)                              |\n| [Relationships](https://discord.com/developers/docs/game-sdk/relationships) | 🟢 ❤️ implemented                          | [RelationshipExample.java](examples/RelationshipExample.java), [FriendNotificationExample.java](examples/FriendNotificationExample.java) |\n| [Storage](https://discord.com/developers/docs/game-sdk/storage)             | 🔴 💔 not implemented                      |                                                                                                                                          |\n| [Store](https://discord.com/developers/docs/game-sdk/store)                 | 🔴 💔 not implemented                      |                                                                                                                                          |\n| [Users](https://discord.com/developers/docs/game-sdk/users)                 | 🟡 ❤️ partially implemented[^users]        | none yet :cry: (see [``userTest()``](src/test/java/de/jcm/discordgamesdk/DiscordTest.java#L216) for now)                                 |\n\n[^activities]: The methods `registerCommand` and `registerSteam` are not implemented, because they simply create shortcuts.\n   The method `acceptRequest` is not implemented, because I cannot figure out how it works. Help is appreciated! 😄\n[^applications]: Only the method `getOAuth2Token` and the custom more exhaustive method `authenticate` are implemented.\n[^users]: The method `getCurrentUserPremiumType` is not implemented because I don't have Discord Nitro, so I cannot test it.\n\n## Installation\n\n### Pre-compiled\n\n#### Maven, Gradle and other build tools\n\nThere are pre-compiled builds on [JitPack](https://jitpack.io/#JnCrMx/discord-game-sdk4j)\ntogether with instructions how to use them for all common build tools.\n\n#### Manual installation\n\nFor projects not using any build tools, download a pre-compiled JAR-file (``discord-game-sdk4j-\u003cversion\u003e.jar``)\nfrom the [releases page](https://github.com/JnCrMx/discord-game-sdk4j/releases).\n\nIf you want, you can also download the JavaDocs (``discord-game-sdk4j-\u003cversion\u003e-javadoc.jar``) or\nthe sources (``discord-game-sdk4j-\u003cversion\u003e-sources.jar``).\n\nAfter downloading those JARs, just add the main JAR to your project's classpath and optionally\nattach sources or JavaDocs.\n\n### Building from source\n\nTo install the library from source first of all clone the repository:\n```shell script\ngit clone https://github.com/JnCrMx/discord-game-sdk4j.git\n```\n\nFinally build (and install) the library with Maven:\n````shell script\nmvn install\n````\n\nIf you want to skip the tests (sometimes they fail for really weird reasons), add ``-DskipTests`` to the command arguments.\n\n## Usage\n\nCreate a ``Core`` object to start using the library:\n````java\ntry(CreateParams params = new CreateParams())\n{\n    params.setClientID(\u003cyour application ID as a long\u003e);\n    params.setFlags(CreateParams.getDefaultFlags());\n\n    try(Core core = new Core(params))\n    {\n        // do something with your Core\n    }\n}\n````\n\nFor real examples see the ``examples/`` directory in this repository.\n\n### Environment Variables\n\n#### `DISCORD_INSTANCE_ID`\n\nThis library supports using the `DISCORD_INSTANCE_ID` environment variable to select a Discord instance to use.\n\nOn Windows, this results in the socket `\\\\.\\pipe\\discord-ipc-${DISCORD_INSTANCE_ID}` being used.\nThis should equal the behaviour of the official native libraries.\n\nOn Linux however, there are multiple locations and sockets, which this library tries to support, but the offical\nlibrary does not.\nTherefore, an order of instances is established as follows:\n1. Discord instances running directly as host applications (i.e. `$XDG_RUNTIME_DIR/discord-ipc-{0,1,2,3,...}`).\n   The following directories (in the order given) are searched: `$XDG_RUNTIME_DIR`, `$TMPDIR`, `$TMP`, `$TEMP`.\n2. Discord instances running as a Flatpak, whose socket is found in\n   `\u003cone of the directories from 1.\u003e/app/com.discordapp.Discord`.\n3. Discord instances running as a Snap, whose socket is found in\n   `\u003cone of the directories from 1.\u003e/snap.discord`.\n4. Discord instances running as a Snap with a different instance name (using the `experimental.parallel-instances` setting),\n   whose socket is found in `\u003cone of the directories from 1.\u003e/snap.discord_${instance_name}` *in alphabetical order*.\n\n**Example:**\nLet's say there are a total of five Discord instances running.\nTwo of them are running on the host system directly, one is running as a Flatpak and one is running as a \"normal\"\nSnap and one running as a Snap (with `experimental.parallel-instances`) as `discord_test`.\n\nThen the two Discord instances on the host system get the `DISCORD_INSTANCE_ID` `0` and `1`.\nThe Flatpak one is getting the `DISCORD_INSTANCE_ID` `2` and the normal Snap one is getting the `DISCORD_INSTANCE_ID` `3`.\nLately, the Snap one installed as `discord_test` gets `DISCORD_INSTANCE_ID` `4`.\n\n#### `DISCORD_IPC_PATH`\n\nTo make it possible to select one specific Discord instance, rather than relying on this ordering,\nthis library introduces the environment variable `DISCORD_IPC_PATH`.\n\nIf this variable is set, this library will **not search for any sockets at all**.\nIt will simply assume that a socket is preset at `$DISCORD_IPC_PATH` and use that one.\n\nThis can be useful for automated tests, that might break on changing Discord instances.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjncrmx%2Fdiscord-game-sdk4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjncrmx%2Fdiscord-game-sdk4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjncrmx%2Fdiscord-game-sdk4j/lists"}