Java interface for Discord's OAuth API, integrated into Discord4J.
D4J-OAuth is designed to be as simple to implement as possible, while still providing the power to do cool stuff. NOTE: YOU MUST BE ON DISCORD4J 2.8.1 OR ABOVE
To start, you'll want to create an instance of DiscordOAuthBuilder
, and provide it a client id, client secret, a redirect URL, and at least one scope. For example
new DiscordOAuthBuilder(client)
.withClientID(args[1])
.withClientSecret(args[2])
.withRedirectUrl("http://localhost:8080/callback")
.withHttpServerOptions(new HttpServerOptions().setPort(8080))
.withScopes(Scope.IDENTIFY, Scope.CONNECTIONS)
.build()
This will create an instanceof of IDiscordOAuth bound to port 8080, with the client ID set to args[1]
and the secret set to args[2]
.
- Butler Bot is a very simple bot written to demonstrate basic interaction with the API.
<dependency>
<groupId>com.github.xaanit</groupId>
<artifactId>D4J-OAuth</artifactId>
<version>master-SNAPSHOT</version>
</dependency>
master-SNAPSHOT
can also be substituted for a GitHub commit.