This page provides a fast introduction to JDA. For a more comprehensive guide, please view the setup guide.
Whilst downloads are available on the Jenkins Server and the JDA GitHub releases pages, it is highly recommended to use a build tool like Gradle or Maven to manage JDA and its dependencies.
!!! Information ""
=== "Maven"
xml <dependency> <groupId>net.dv8tion</groupId> <artifactId>JDA</artifactId> <version>VERSION</version> </dependency>
=== "Maven (No Audio)"
xml <dependency> <groupId>net.dv8tion</groupId> <artifactId>JDA</artifactId> <version>VERSION</version> <exclusions> <exclusion> <groupId>club.minnced</groupId> <artifactId>opus-java</artifactId> </exclusion> </exclusions> </dependency>
=== "Gradle"
```groovy
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:VERSION")
}
```
=== "Gradle (No Audio)"
```groovy
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:VERSION") {
exclude module: 'opus-java'
}
}
```
Remember to replace the `VERSION` with the version you would like to use. Version information can be found from
[JDA Discord Server](https://discord.gg/0hMr4ce0tIk3pSjp), [JDA GitHub](https://github.com/DV8FromTheWorld/JDA/releases) or
[Maven Central](https://mvnrepository.com/artifact/net.dv8tion/JDA/).
[](https://ci.dv8tion.net/job/JDA5/lastSuccessfulBuild/)
!!! example "Simple Ready Listener Example" ```java public class ReadyListener implements ListenerAdapter { public static void main(String[] args) throws LoginException { JDA jda = JDABuilder.createDefault(BOT_TOKEN) .addEventListeners(new ReadyListener()).build(); }
@Override
public void onReady(ReadyEvent event)
{
System.out.println("JDA has started!");
}
}
```
!!! example "Simple Message Logging Example" ```java public class MessageListener extends ListenerAdapter { public static void main(String[] args) throws LoginException { JDA jda = JDABuilder.createDefault(BOT_TOKEN) .enableIntents(GatewayIntent.MESSAGE_CONTENT) .build(); jda.addEventListeners(new MessageListener()); }
@Override
public void onMessageReceived(MessageReceivedEvent event)
{
if (event.isFromType(ChannelType.TEXT))
{
System.out.printf("[%s][%s] %#s: %s%n", event.getGuild().getName(),
event.getChannel().getName(), event.getAuthor(), event.getMessage().getContentDisplay());
}
else
{
System.out.printf("[PM] %#s: %s%n", event.getAuthor(), event.getMessage().getContentDisplay());
}
}
}
```
!!! information "More Examples" We provide a small set of Examples in the Example Directory.
You can find the latest Javadocs and the legacy Javadocs on the Jenkins server.
For other versions of JDA, the javadocs jar can be downloaded from the version's page.
For example, the v4.2.0_200 javadocs can be found at: https://ci.dv8tion.net/job/JDA/200/, which can be extracted for its docs.
If you need help, or just want to talk with the JDA or other Devs, you can join the Official JDA Discord Guild.
Alternatively, you can visit the #java_jda channel in the Unofficial Discord API Guild.
The dedicated JDA guild is generally more active, and will often help you faster.
For guides and setup help, this wiki aims to provide information.
If you're looking for guides or setup help, check out our Getting Started pages.
If you want to contribute to JDA, make sure to base your branch off of our master branch (or a feature-branch) and create your PR into that same branch.
It's recommended to ask (preferably in the JDA Guild) about a PR before starting one, to ensure that it is a welcome change and that it isn't already being worked on.
More information can be found on our Contributing page.
We have dedicated library development and wiki development channels on our Discord server, where you can ask questions or suggest ideas.
This project requires Java 8.
For other dependencies, see README