JavaDestinyAPI
A Java wrapper for the Destiny 2 API
Install / Use
/learn @dec4234/JavaDestinyAPIREADME
JavaDestinyAPI
This library is used as an interface to the API for the game Destiny 2, created by Bungie.
The API is a work in-progress, contributions are welcome. Please note that development is on-going and the latest versions may be prone to bugs. If you find any please create an issue to report it.
Getting Started
This project can be currently accessed through the jitpack repository, which allows any github repo to be used as a dependency
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
And then this dependency:
<dependency>
<groupId>com.github.dec4234</groupId>
<artifactId>JavaDestinyAPI</artifactId>
<version>master</version>
</dependency>
(You may need to replace "master" with the latest commit hash)
If you happen to need a JAR version, check out releases.
Getting the API Set Up
You need to get an API key from bungie.net/developer
DestinyAPI api = new DestinyAPI("YOUR API KEY HERE");
IMPORTANT: DestinyAPI MUST be the first thing initialized before making any interactions with the API! This is because all interactions with the API rely on the API Key set in DestinyAPI.
Getting the time played in hours, of the user named dec4234#9904
System.out.println(DestinyAPI.getUserWithName("dec4234#9904").getTimePlayed() / 60.0);
Get the name of the founder of a clan
System.out.println(new Clan("Heavenly Mayhem").getFounder().getSupplementalDisplayName());
Examples
- Check out the wiki for more specific examples and information.
- Check out the discord bot that I made for my clan using this library
An aside about APIException
As of 4/30/2024, all functions that interact with the API in any way (i.e. could make an HTTP request) throw APIException. This is to allow for you, the user, to handle API errors in the way you see fit. This means you must use a try/catch or add "throws" to your function signature. <br> This was done because the old way could create a lot of runtime exceptions which were hard to account for. The most important error you may want to look at is APIOfflineException which indicates when Bungie has disabled the API for maintenence. This may be useful to tell your user's that the API is offline.
How's it made?
There is both official and unofficial documentation for the API available on destinydevs.github.io and on the offical bungie api documentation.
TO-DO
- Managing inventory / Item transferring
- Collections / Triumphs
- Revamping the wiki
Related Skills
gh-issues
349.2kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
349.2kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
taskflow-inbox-triage
349.2kname: taskflow-inbox-triage description: Example TaskFlow authoring pattern for inbox triage. Use when messages need different treatment based on intent, with some routes notifying immediately, some w
