Aether
Aether is a set of building blocks for Discord bots written with JDA and jda-commands. It handles the parts many bots need again and again: who may use which command, Discord and Ko-fi purchases, verified mail addresses, Discord login for a web dashboard and JSON views of Discord objects.
Aether does not store anything itself. Wherever data has to be saved, you extend an abstract class or implement an interface and keep the data in your own database.
Requirements
| What | Version |
|---|---|
| Java | 25 or newer. Aether is compiled for Java 25, because jda-commands 5 needs it. |
| JDA | 6. Aether brings JDA 6.7.0. |
| jda-commands | 5. Aether brings jda-commands 5.1.1. |
| Jackson | 3 (tools.jackson). The modules that read or write JSON bring it. |
| Javalin | 7, only for common-web and discord-oauth. |
Modules
Pick the modules you need. Each one brings the modules it builds on.
| Artifact | Java module | What it does |
|---|---|---|
common | dev.chojo.aether.common | Shared parts: user lookup, registries, an event manager with exception handlers, autocomplete helpers, colours. See Common. |
supporter | dev.chojo.aether.supporter | Subscriptions, features and access checks for commands. See Supporter. |
kofi | dev.chojo.aether.kofi | Turns Ko-fi webhooks into supporter purchases. See Ko-fi. |
mailing | dev.chojo.aether.mailing | Registers and verifies mail addresses and sends mails. See Mailing. |
discord-oauth | dev.chojo.aether.discordoauth | Discord login for a Javalin web app and a small Discord API client. See Discord OAuth. |
serialization | dev.chojo.aether.serialization | Jackson serializers that turn guilds, roles, channels and members into JSON. See Serialization. |
common-web | dev.chojo.aether.commonweb | Error types and helpers for Javalin. See Common web. |
aether | Every module above in one artifact. |
kofi builds on supporter and mailing. discord-oauth builds on common-web. Every other module builds on
common.
Add the dependency
Aether is published to Maven Central with the group dev.chojo.aether. Snapshots are on EldoNexus
(https://eldonexus.de/repository/maven-snapshots/).
This example adds the supporter and Ko-fi modules:
- Gradle (Kotlin DSL)
- Gradle (Groovy)
- Maven
repositories {
mavenCentral()
}
dependencies {
implementation("dev.chojo.aether:supporter:2.0.0")
implementation("dev.chojo.aether:kofi:2.0.0")
}
repositories {
mavenCentral()
}
dependencies {
implementation 'dev.chojo.aether:supporter:2.0.0'
implementation 'dev.chojo.aether:kofi:2.0.0'
}
<dependencies>
<dependency>
<groupId>dev.chojo.aether</groupId>
<artifactId>supporter</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>dev.chojo.aether</groupId>
<artifactId>kofi</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
To get everything at once, use dev.chojo.aether:aether:2.0.0.
How the modules fit together
A typical bot with paid features uses them like this:
- Supporter describes your subscriptions and features and checks every command before it runs.
- Purchases come in from Discord through the entitlement service and from Ko-fi through the Ko-fi service.
- Ko-fi only knows the buyer's mail address. Mailing links that address to a Discord user.
- A web dashboard logs users in with Discord OAuth and shows guild data with Serialization.
You can use each module on its own as well.
Where to go next
- Common
- Supporter
- Ko-fi
- Mailing
- Discord OAuth
- Serialization
- Common web
- Javadoc: every class and method.