Skip to content

Commit 4aee37f

Browse files
committed
Add DAVE support
1 parent bd8ace7 commit 4aee37f

5 files changed

Lines changed: 20 additions & 11 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM azul/zulu-openjdk:17-jre-latest
1+
FROM azul/zulu-openjdk:25-jre-latest
22
RUN groupadd -r -g 999 ukulele && useradd -rd /opt/ukulele -g ukulele -u 999 -ms /bin/bash ukulele
33
COPY --chown=ukulele:ukulele build/libs/ukulele.jar /opt/ukulele/ukulele.jar
44
USER ukulele
55
WORKDIR /opt/ukulele/
6-
ENTRYPOINT ["java", "-jar", "/opt/ukulele/ukulele.jar"]
6+
ENTRYPOINT ["java", "--enable-native-access=ALL-UNNAMED", "-jar", "/opt/ukulele/ukulele.jar"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Ukulele is a bot made by the creator and collaborators of FredBoat. The concept is to replicate FredBoat while keeping it simple. The original stack is engineered for serving millions of servers, and is thus too complex to selfhost.
55

6-
The bot is self-contained and only requires Java 17 to run. This bot uses some of the underlying technology behind Lavalink without actually requiring you to host Lavalink.
6+
The bot is self-contained and only requires Java 25 to run. This bot uses some of the underlying technology behind Lavalink without actually requiring you to host Lavalink.
77

88
## Features
99
- Basic player commands (::play, ::list, ::skip, ::shuffle)
@@ -13,7 +13,7 @@ The bot is self-contained and only requires Java 17 to run. This bot uses some o
1313
## Host it yourself
1414

1515
### Manual
16-
- Install Java 11
16+
- Install Java 25
1717
- Make a copy of `ukulele.example.yml` and rename it to `ukulele.yml`
1818
- Input the bot token [(guide)](https://discordjs.guide/preparations/setting-up-a-bot-application.html)
1919
- Make sure to enable 'Message Content Intent' in your bot settings on Discord

build.gradle.kts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111

1212
group = "dev.arbjerg"
1313
version = "0.1"
14-
java.sourceCompatibility = JavaVersion.VERSION_17
14+
java.sourceCompatibility = JavaVersion.VERSION_25
1515

1616
// r2dbc-h2 1.1.0.RELEASE was compiled against H2 2.4.240; Spring Boot BOM would downgrade to 2.3.232
1717
extra["h2.version"] = "2.4.240"
@@ -26,6 +26,9 @@ repositories {
2626

2727
dependencies {
2828
implementation("net.dv8tion:JDA:6.4.1")
29+
implementation("club.minnced:jdave-api:0.1.8")
30+
runtimeOnly("club.minnced:jdave-native-linux-x86-64:0.1.8")
31+
runtimeOnly("club.minnced:jdave-native-linux-aarch64:0.1.8")
2932
implementation("dev.arbjerg:lavaplayer:2.2.6")
3033
implementation("dev.lavalink.youtube:v2:1.18.1")
3134
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
@@ -44,6 +47,10 @@ dependencies {
4447
}
4548
}
4649

50+
tasks.withType<org.springframework.boot.gradle.tasks.run.BootRun> {
51+
jvmArgs("--enable-native-access=ALL-UNNAMED")
52+
}
53+
4754
tasks.withType<BootJar> {
4855
archiveFileName.set("ukulele.jar")
4956
doLast {
@@ -62,6 +69,6 @@ tasks.withType<Test> {
6269
tasks.withType<KotlinCompile> {
6370
compilerOptions {
6471
freeCompilerArgs.add("-Xjsr305=strict")
65-
jvmTarget.set(JvmTarget.JVM_17)
72+
jvmTarget.set(JvmTarget.JVM_25)
6673
}
6774
}

src/main/kotlin/dev/arbjerg/ukulele/jda/JdaConfig.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
package dev.arbjerg.ukulele.jda
22

3+
import club.minnced.discord.jdave.interop.JDaveSessionFactory
34
import dev.arbjerg.ukulele.config.BotProps
5+
import net.dv8tion.jda.api.audio.AudioModuleConfig
46
import net.dv8tion.jda.api.entities.Activity
5-
import net.dv8tion.jda.api.requests.GatewayIntent
6-
import net.dv8tion.jda.api.sharding.ShardManager
7-
import org.springframework.context.annotation.Bean
8-
import org.springframework.context.annotation.Configuration
97
import net.dv8tion.jda.api.requests.GatewayIntent.*
108
import net.dv8tion.jda.api.sharding.DefaultShardManagerBuilder
9+
import net.dv8tion.jda.api.sharding.ShardManager
1110
import net.dv8tion.jda.api.utils.cache.CacheFlag
1211
import net.dv8tion.jda.api.utils.messages.MessageRequest
12+
import org.springframework.context.annotation.Bean
13+
import org.springframework.context.annotation.Configuration
1314
import javax.security.auth.login.LoginException
1415
import kotlin.concurrent.thread
1516

@@ -35,6 +36,7 @@ class JdaConfig {
3536
)
3637

3738
val builder = DefaultShardManagerBuilder.create(botProps.token, intents)
39+
.setAudioModuleConfig(AudioModuleConfig().withDaveSessionFactory(JDaveSessionFactory()))
3840
.disableCache(
3941
CacheFlag.ACTIVITY,
4042
CacheFlag.EMOJI,

ukulele

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
./gradlew --no-daemon build
33
cd `dirname "$0"`
4-
java -jar "build/libs/ukulele.jar"
4+
java --enable-native-access=ALL-UNNAMED -jar "build/libs/ukulele.jar"

0 commit comments

Comments
 (0)