Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import org.jetbrains.gradle.ext.settings
import org.jetbrains.gradle.ext.taskTriggers

Expand Down Expand Up @@ -25,13 +25,13 @@
maven(url = "https://jitpack.io")
}

dependencies {

Check warning on line 28 in build.gradle.kts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Group dependencies by their destination.

See more on https://sonarcloud.io/project/issues?id=Wikijito7_ECIBotKt&issues=AZ7q5ye5ort7jUkVP_us&open=AZ7q5ye5ort7jUkVP_us&pullRequest=113
// Kord - Local SNAPSHOT JARs (voice encryption branch)
// TODO: Switch back to version catalog when Kord merges voice encryption to main
// TODO: Switch back to version catalog when Kord merges voice encryption to main (kord#1063)
implementation(fileTree("libs") { include("kord-*.jar") })

// Transitive dependencies required by local Kord JARs (flatDir doesn't resolve these)
// TODO: Remove when Kord merges voice encryption to main
// TODO: Remove when Kord merges voice encryption to main (kord#1063)
implementation(libs.kotlinx.datetime)
implementation(libs.kord.cache)
implementation(libs.kord.cache.map)
Expand Down Expand Up @@ -65,6 +65,14 @@
// Serialization
implementation(libs.kotlinx.serialization)

// libdave-jvm for DAVE protocol
implementation(libs.libdave.api)
implementation(libs.libdave.impl.jni)
runtimeOnly(libs.libdave.natives.darwin)
runtimeOnly(libs.libdave.natives.linuxX64)
runtimeOnly(libs.libdave.natives.linuxAarch64)
runtimeOnly(libs.libdave.natives.winX64)

// Lavaplayer
implementation(libs.lavaplayer)
implementation(libs.lavaplayer.youtube)
Expand Down
15 changes: 11 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[versions]
jacoco = "0.8.12"
# Kord is now loaded from local libs/ folder as SNAPSHOT JARs
# See libs/ directory for the JAR files
kotlin = "2.1.21"
kord = "feature-dave-support-SNAPSHOT"
kotlin = "2.3.10"
ktor = "3.1.3"
mockk = "1.14.2"
slf4j = "2.0.17"
Expand All @@ -18,6 +17,8 @@ lavaplayer-youtube = "1.17.0"
lavaplayer-lavasrc = "4.8.1"
idea-ext = "1.1.10"
junit-parametized = "5.13.0"
libdave = "0.1.2"
libdave-natives = "0.1.3"

[libraries]
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
Expand All @@ -29,7 +30,7 @@ ktor-client-serialization-kotlin-json = { module = "io.ktor:ktor-serialization-k
ktor-client-client-resources = { module = "io.ktor:ktor-client-resources", version.ref = "ktor" }
ktor-client-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" }
ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" }
# TODO: Re-enable when Kord merges voice encryption branch to main
# Kord - from local JARs in libs/ until DAVE support is merged to main (kord#1063)
# kord-core = { module = "dev.kord:kord-core", version.ref = "kord" }
# kord-core-voice = { module = "dev.kord:kord-core-voice", version.ref = "kord"}
# kord-voice = { module = "dev.kord:kord-voice", version.ref = "kord" }
Expand All @@ -51,6 +52,12 @@ koin-bom = { module = "io.insert-koin:koin-bom", version.ref = "koin" }
koin-core = { module = "io.insert-koin:koin-core" }
kotlinx-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
junit-parametrized = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-parametized" }
libdave-api = { module = "moe.kyokobot.libdave:api", version.ref = "libdave" }
libdave-impl-jni = { module = "moe.kyokobot.libdave:impl-jni", version.ref = "libdave" }
libdave-natives-darwin = { module = "moe.kyokobot.libdave:natives-darwin", version.ref = "libdave-natives" }
libdave-natives-linuxX64 = { module = "moe.kyokobot.libdave:natives-linux-x86-64", version.ref = "libdave-natives" }
libdave-natives-linuxAarch64 = { module = "moe.kyokobot.libdave:natives-linux-aarch64", version.ref = "libdave-natives" }
libdave-natives-winX64 = { module = "moe.kyokobot.libdave:natives-win-x86-64", version.ref = "libdave-natives" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added libs/kord-core-feature-dave-support-SNAPSHOT.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added libs/kord-rest-feature-dave-support-SNAPSHOT.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/kotlin/commands/queue/QueueCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class QueueCommand(
key = LocalizationKeys.QUEUE_EMBED_DESCRIPTION,
guildId = guildId,
discordLocale = discordLocale,
arguments = arrayOf(queue.size, guildName)
arguments = arrayOf<Any>(queue.size, guildName)
)
val currentPageContent = displayQueue.takeIf { it.isNotEmpty() }?.get(0)?.let { listOf(it) }
response.respond {
Expand Down Expand Up @@ -137,7 +137,7 @@ class QueueCommand(
key = LocalizationKeys.QUEUE_EMBED_DESCRIPTION,
guildId = guildId,
discordLocale = discordLocale,
arguments = arrayOf(queueLength, guildName)
arguments = arrayOf<Any>(queueLength, guildName)
)
val currentPageContent = displayQueuePage?.let { listOf(it) }
interaction.message.edit {
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/services/lavaplayer/GuildLavaPlayerService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class GuildLavaPlayerService(
key = LocalizationKeys.FOUND_TRACK_LIST,
guildId = guildId,
discordLocale = discordLocale,
arguments = arrayOf(playlist.name, playlist.tracks.size)
arguments = arrayOf<Any>(playlist.name, playlist.tracks.size)
)
)
connectToVoiceChannel()
Expand All @@ -451,14 +451,14 @@ class GuildLavaPlayerService(
key = if (addToFront) LocalizationKeys.NEXT_ADDED_SONGS_TO_QUEUE_WITH_LINK else LocalizationKeys.ADDED_SONGS_TO_QUEUE_WITH_LINK,
guildId = guildId,
discordLocale = discordLocale,
arguments = arrayOf(playlist.name.toSanitizedMarkdownLink(playlistUrl), playlist.tracks.size)
arguments = arrayOf<Any>(playlist.name.toSanitizedMarkdownLink(playlistUrl), playlist.tracks.size)
)
} else {
localizationService.getStringFormat(
key = if (addToFront) LocalizationKeys.NEXT_ADDED_SONGS_TO_QUEUE else LocalizationKeys.ADDED_SONGS_TO_QUEUE,
guildId = guildId,
discordLocale = discordLocale,
arguments = arrayOf(playlist.name, playlist.tracks.size)
arguments = arrayOf<Any>(playlist.name, playlist.tracks.size)
)
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/simplelogger.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Default logging detail level for all instances of SimpleLogger.
# Must be one of ("trace", "debug", "info", "warn", or "error").
# If not specified, defaults to "info".
org.slf4j.simpleLogger.defaultLogLevel=info
org.slf4j.simpleLogger.defaultLogLevel=trace
org.slf4j.simpleLogger.logFile=logs/bot.log

# Logging detail level for a SimpleLogger instance named "xxxxx".
# Must be one of ("trace", "debug", "info", "warn", or "error").
Expand Down
8 changes: 7 additions & 1 deletion src/test/kotlin/mock/DiscordMocks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package mock
import dev.kord.common.entity.DiscordMessage
import dev.kord.common.entity.DiscordUser
import dev.kord.common.entity.Snowflake
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.OptionalInt
import dev.kord.core.Kord
import dev.kord.core.behavior.channel.BaseVoiceChannelBehavior
import dev.kord.core.behavior.interaction.response.DeferredPublicMessageInteractionResponseBehavior
Expand Down Expand Up @@ -30,7 +32,7 @@ val mockUser = mockk<DiscordUser> {
every { publicFlags } returns mockk()
every { banner } returns null
every { accentColor } returns null
every { avatarDecoration } returns mockk()
every { avatarDecorationData } returns Optional.Missing()
}

val mockedMessage = mockk<Message> {
Expand Down Expand Up @@ -62,10 +64,14 @@ val mockedDiscordMessage = mockk<DiscordMessage> {
every { application } returns mockk()
every { applicationId } returns mockk()
every { messageReference } returns mockk()
every { messageSnapshots } returns Optional.Missing()
every { flags } returns mockk()
every { stickers } returns mockk()
every { referencedMessage } returns mockk()
every { interactionMetadata } returns Optional.Missing()
every { interaction } returns mockk()
every { thread } returns Optional.Missing()
every { position } returns OptionalInt.Missing
every { components } returns mockk()
every { roleSubscriptionData } returns mockk()
every { id } returns mockk()
Expand Down
Loading