cjda-util
cjda-util is a toolbox for Discord bots built on JDA. It takes care of the parts every bot needs and nobody wants to write twice.
What you get:
- slash, message and user commands built with a small builder, deployed for you,
- localization of command names and messages from
.propertiesfiles, - menus and modals that call your code when someone clicks or submits,
- paginated messages with previous and next buttons,
- conversations that walk a user through several steps,
- premium checks for Discord SKUs,
- bot list integration for server counts and vote webhooks,
- a set of smaller helpers for parsing, mentions and configuration.
Requirements
| What | Version |
|---|---|
| Java | 21 or newer. cjda-util is compiled for Java 21. |
| JDA | 6.7.0. cjda-util brings JDA with it, so you do not need to add it yourself. |
cjda-util also brings Javalin 6, Jackson 2, Guava, Apache Commons Text and JSpecify as dependencies.
Add the dependency
cjda-util is published to EldoNexus.
- Gradle (Kotlin DSL)
- Gradle (Groovy)
- Maven
repositories {
maven("https://eldonexus.de/repository/maven-public/")
}
dependencies {
implementation("de.chojo:cjda-util:3.0.0")
}
repositories {
maven { url 'https://eldonexus.de/repository/maven-public/' }
}
dependencies {
implementation 'de.chojo:cjda-util:3.0.0'
}
<repositories>
<repository>
<id>eldonexus</id>
<url>https://eldonexus.de/repository/maven-public/</url>
</repository>
</repositories>
<dependency>
<groupId>de.chojo</groupId>
<artifactId>cjda-util</artifactId>
<version>3.0.0</version>
</dependency>
Snapshots of the next version are in https://eldonexus.de/repository/maven-snapshots/.
Upgrading from 2.x
- The version no longer carries the JDA version.
2.15.1+jda-6.7.0becomes3.0.0. This page lists the JDA version each release is built against. - Nullness annotations moved from
javax.annotation(jsr305) to JSpecify. cjda-util no longer brings jsr305 along. If your code still usesjavax.annotation, addcom.google.code.findbugs:jsr305yourself. - cjda-util is now licensed under AGPL-3.0-only.
Java modules
cjda-util is a named module, de.chojo.jdautil. Most bots run on the class path and do not need to care about this.
If your bot is a module itself, require it:
module my.bot {
requires de.chojo.jdautil;
}
cjda-util reads some of your classes with Jackson. Open these packages to com.fasterxml.jackson.databind:
- the package of your configuration class, if you use
Configuration, - the package of your own vote payloads, if you add a custom bot list.
Keep your locale files at the root of your resources, as shown in localization.
Javadoc
The Javadoc is published with every release.