Skip to content
Ivan Abarca edited this page Mar 29, 2021 · 45 revisions

We have migrated to https://docs.discord4j.com and this wiki will soon be archived. Please be sure to check that site for the latest documentation.

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 setup Maven or Gradle, refer to the documentation for your specific IDE:

Replace VERSION below with one of these

  • Latest stable (v3.1.x) Maven Central
  • Latest pre-release (v3.2.x) Maven Central

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 aide 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"
)