Welcome
Welcome to the Discord4J wiki! Discord4J is a reactive Java wrapper for the official Discord Bot API. This wiki will cover all the basics on reactive programming, how to utilize the Discord4J library effectively, and common examples in reactive and blocking contexts. Feel free to explore the various topics this wiki covers using the links in the sidebar.
Download / Installation
The recommended way to get Discord4J is to use a build automation tool like Maven or Gradle. To set up Maven or Gradle, refer to the documentation for your specific IDE:
Versions
Discord4J | Support | Gateway/API | Intents |
---|---|---|---|
v3.2.x | In development | v8 | Mandatory, non-privileged default |
v3.1.x | Current | v6 | Optional, no intent default |
v3.0.x | Maintenance only | v6 | No intents support |
Replace VERSION below with one of these:
Maven
<dependencies>
<dependency>
<groupId>com.discord4j</groupId>
<artifactId>discord4j-core</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'com.discord4j:discord4j-core:VERSION'
}
SBT
libraryDependencies ++= Seq(
"com.discord4j" % "discord4j-core" % "VERSION"
)
If you prefer using experimental, "bleeding-edge", unstable builds, refer to Using Jitpack.
Logging
While optional, we do recommend installing and configuring a logging implementation to aid in debugging and provide useful information for day-to-day operations; plus, it's good practice. Discord4J uses Reactor's logging implementation, which is compatible with any SLF4J implementation. We recommend using Logback for maximum flexibility and customization; check our dedicated Logging guide for details.
Maven
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback_version}</version>
</dependency>
</dependencies>
Gradle
dependencies {
implementation 'ch.qos.logback:logback-classic:$logback_version'
}
SBT
libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % s"$logbackVersion"
)