diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c8b802825..cd1431665 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ permissions: write-all jobs: mikbot: - uses: mikbot/mikbot-workflow/.github/workflows/mikbot-workflow.yml@v1.3.1 + uses: mikbot/mikbot-workflow/.github/workflows/mikbot-workflow.yml@v1.4.0 with: run-maven-publish: true update-binary-repository: true diff --git a/.github/workflows/gradle_plugin_ci.yml b/.github/workflows/gradle_plugin_ci.yml index 7f1137b8c..0589e1f41 100644 --- a/.github/workflows/gradle_plugin_ci.yml +++ b/.github/workflows/gradle_plugin_ci.yml @@ -33,11 +33,11 @@ jobs: needs: gradleValidation steps: - uses: actions/checkout@v3 - - name: Set up JDK 19 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 19 + java-version: 21 - name: Test with Gradle run: ./gradlew gradle-plugin:classes - name: Login to Gradle Plugin Portal diff --git a/Dockerfile b/Dockerfile index 93ce52998..747c04a14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:20-jre-alpine +FROM eclipse-temurin:21-jre-alpine WORKDIR /usr/app COPY runtime/build/install/mikmusic ./ diff --git a/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/Confirmation.kt b/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/Confirmation.kt index 9b6ba6123..d3db6c8f3 100644 --- a/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/Confirmation.kt +++ b/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/Confirmation.kt @@ -8,7 +8,6 @@ import com.kotlindiscord.kord.extensions.modules.unsafe.annotations.UnsafeAPI import com.kotlindiscord.kord.extensions.modules.unsafe.contexts.UnsafeSlashCommandContext import com.kotlindiscord.kord.extensions.modules.unsafe.types.respondEphemeral import com.kotlindiscord.kord.extensions.modules.unsafe.types.respondPublic -import com.kotlindiscord.kord.extensions.types.respond import com.kotlindiscord.kord.extensions.utils.waitFor import dev.kord.common.entity.ButtonStyle import dev.kord.core.behavior.interaction.followup.FollowupMessageBehavior diff --git a/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/ListPaginator.kt b/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/ListPaginator.kt index 4c0975f04..57a97f7be 100644 --- a/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/ListPaginator.kt +++ b/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/ListPaginator.kt @@ -4,8 +4,6 @@ import com.kotlindiscord.kord.extensions.pagination.builders.PaginatorBuilder import dev.kord.core.behavior.UserBehavior import dev.kord.rest.builder.message.EmbedBuilder import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.drop -import kotlinx.coroutines.flow.take import kotlinx.coroutines.flow.toList import kotlin.math.ceil @@ -21,14 +19,14 @@ import kotlin.math.ceil * @param additionalConfig additional [PaginatorBuilder] config * @param additionalPageConfig additional [EmbedBuilder] config, applied to each page */ -public suspend fun PaginatorBuilder.forList( +public fun PaginatorBuilder.forList( user: UserBehavior, items: List, mapper: suspend (T) -> String, title: suspend (current: Int, total: Int) -> String, chunkSize: Int = 8, enumerate: Boolean = true, - additionalConfig: suspend PaginatorBuilder.() -> Unit = {}, + additionalConfig: PaginatorBuilder.() -> Unit = {}, additionalPageConfig: suspend EmbedBuilder.() -> Unit = {}, ): Unit = forList(user, items.size, { offset, limit -> items.subList(offset, (offset + limit).coerceAtMost(items.size)) @@ -55,21 +53,31 @@ public suspend fun PaginatorBuilder.forFlow( title: suspend (current: Int, total: Int) -> String, chunkSize: Int = 8, enumerate: Boolean = true, - additionalConfig: suspend PaginatorBuilder.() -> Unit = {}, + additionalConfig: PaginatorBuilder.() -> Unit = {}, additionalPageConfig: suspend EmbedBuilder.() -> Unit = {}, -): Unit = forList(user, total.toInt(), { offset, _ -> - items.drop(offset).take(chunkSize).toList() -}, mapper, title, chunkSize, enumerate, additionalConfig, additionalPageConfig) +) { + val list = items.toList() + forList( + user, + list, + mapper, + title, + chunkSize, + enumerate, + additionalConfig, + additionalPageConfig + ) +} -private suspend fun PaginatorBuilder.forList( +private fun PaginatorBuilder.forList( user: UserBehavior, size: Int, - subList: suspend (offset: Int, limit: Int) -> List, + subList: (offset: Int, limit: Int) -> List, mapper: suspend (T) -> String, title: suspend (current: Int, end: Int) -> String, chunkSize: Int = 8, enumerate: Boolean = true, - additionalConfig: suspend PaginatorBuilder.() -> Unit = {}, + additionalConfig: PaginatorBuilder.() -> Unit = {}, additionalPageConfig: suspend EmbedBuilder.() -> Unit = {}, ) { owner = user @@ -92,7 +100,7 @@ private fun PaginatorBuilder.addPage( items: List, enumerate: Boolean, mapper: suspend (T) -> String, - additionalPageConfig: suspend EmbedBuilder.() -> Unit + additionalPageConfig: suspend EmbedBuilder.() -> Unit, ) { page { this.title = title((myOffset + 1), pages.groups.size) diff --git a/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/MessageBuilder.kt b/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/MessageBuilder.kt index 6390d9efd..182be8f1e 100644 --- a/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/MessageBuilder.kt +++ b/api/src/main/kotlin/dev/schlaubi/mikbot/plugin/api/util/MessageBuilder.kt @@ -1,7 +1,6 @@ package dev.schlaubi.mikbot.plugin.api.util import com.kotlindiscord.kord.extensions.commands.CommandContext -import com.kotlindiscord.kord.extensions.types.respond import dev.kord.core.behavior.interaction.followup.FollowupMessageBehavior import dev.kord.rest.builder.message.create.MessageCreateBuilder import dev.kord.rest.builder.message.modify.MessageModifyBuilder diff --git a/buildSrc/src/main/kotlin/mikbot-module.gradle.kts b/buildSrc/src/main/kotlin/mikbot-module.gradle.kts index 078b3207d..e761ce6ee 100644 --- a/buildSrc/src/main/kotlin/mikbot-module.gradle.kts +++ b/buildSrc/src/main/kotlin/mikbot-module.gradle.kts @@ -19,5 +19,5 @@ tasks { } kotlin { - jvmToolchain(20) + jvmToolchain(21) } diff --git a/core/database-i18n/src/main/kotlin/dev/schlaubi/mikbot/core/i18n/database/settings/LanguageCommand.kt b/core/database-i18n/src/main/kotlin/dev/schlaubi/mikbot/core/i18n/database/settings/LanguageCommand.kt index c6ead7f48..83c345178 100644 --- a/core/database-i18n/src/main/kotlin/dev/schlaubi/mikbot/core/i18n/database/settings/LanguageCommand.kt +++ b/core/database-i18n/src/main/kotlin/dev/schlaubi/mikbot/core/i18n/database/settings/LanguageCommand.kt @@ -4,7 +4,6 @@ import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.stringChoice import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand import com.kotlindiscord.kord.extensions.i18n.SupportedLocales -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.core.i18n.database.LangaugeUser import dev.schlaubi.mikbot.core.i18n.database.LanguageDatabase import dev.schlaubi.mikbot.plugin.api.settings.SettingsModule diff --git a/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/DeleteCommand.kt b/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/DeleteCommand.kt index 217210cfe..359700681 100644 --- a/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/DeleteCommand.kt +++ b/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/DeleteCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikbot.core.gdpr -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.plugin.api.util.confirmation fun GDPRModule.deleteCommand() = ephemeralSubCommand { diff --git a/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/InfoCommand.kt b/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/InfoCommand.kt index 43114bb21..50f72e3de 100644 --- a/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/InfoCommand.kt +++ b/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/InfoCommand.kt @@ -1,7 +1,6 @@ package dev.schlaubi.mikbot.core.gdpr import com.kotlindiscord.kord.extensions.commands.CommandContext -import com.kotlindiscord.kord.extensions.types.respond import dev.kord.rest.builder.message.EmbedBuilder import dev.kord.rest.builder.message.create.embed import dev.schlaubi.mikbot.core.gdpr.api.AnonymizedData diff --git a/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/RequestCommand.kt b/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/RequestCommand.kt index 84102e70b..03761ca2d 100644 --- a/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/RequestCommand.kt +++ b/core/gdpr/src/main/kotlin/dev/schlaubi/mikbot/core/gdpr/RequestCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikbot.core.gdpr -import com.kotlindiscord.kord.extensions.types.editingPaginator import dev.kord.rest.builder.message.EmbedBuilder import dev.schlaubi.mikbot.plugin.api.util.effectiveAvatar import dev.schlaubi.stdx.core.paginate diff --git a/core/redeploy-hook/src/main/kotlin/dev/schlaubi/mikbot/core/redeploy_hook/RedeployCommand.kt b/core/redeploy-hook/src/main/kotlin/dev/schlaubi/mikbot/core/redeploy_hook/RedeployCommand.kt index 86dcac887..d398c0903 100644 --- a/core/redeploy-hook/src/main/kotlin/dev/schlaubi/mikbot/core/redeploy_hook/RedeployCommand.kt +++ b/core/redeploy-hook/src/main/kotlin/dev/schlaubi/mikbot/core/redeploy_hook/RedeployCommand.kt @@ -2,7 +2,6 @@ package dev.schlaubi.mikbot.core.redeploy_hook import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.core.redeploy_hook.api.RedeployExtensionPoint import dev.schlaubi.mikbot.plugin.api.getExtensions import dev.schlaubi.mikbot.plugin.api.owner.OwnerModule diff --git a/gradle.properties b/gradle.properties index d65489af8..948f5673e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,3 +4,4 @@ kotlin.code.style=official org.gradle.parallel=true kotlin.mpp.stability.nowarn=true org.gradle.caching=true +kotlin.experimental.tryK2=true diff --git a/music/build.gradle.kts b/music/build.gradle.kts index 1dd232f7a..d07639b05 100644 --- a/music/build.gradle.kts +++ b/music/build.gradle.kts @@ -1,3 +1,3 @@ subprojects { - version = "3.1.10-SNAPSHOT" + version = "3.2.0-SNAPSHOT" } diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/ClearCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/ClearCommand.kt index a703abe3c..3de583511 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/ClearCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/ClearCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikmusic.commands -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.core.MusicModule suspend fun MusicModule.clearCommand() = ephemeralControlSlashCommand { diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/FixCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/FixCommand.kt index 6020b4da6..e815056b0 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/FixCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/FixCommand.kt @@ -1,7 +1,6 @@ package dev.schlaubi.mikmusic.commands import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext -import com.kotlindiscord.kord.extensions.types.edit import com.kotlindiscord.kord.extensions.utils.waitFor import dev.kord.common.entity.ButtonStyle import dev.kord.common.entity.Permission diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/LycricsCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/LycricsCommand.kt index b453b27a0..d621d9b13 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/LycricsCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/LycricsCommand.kt @@ -3,8 +3,6 @@ package dev.schlaubi.mikmusic.commands import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalString import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand -import com.kotlindiscord.kord.extensions.types.editingPaginator -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.plugin.api.util.forList import dev.schlaubi.mikmusic.checks.musicQuizAntiCheat import dev.schlaubi.mikmusic.core.MusicModule diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/MoveCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/MoveCommand.kt index f7127546d..1a965a92f 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/MoveCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/MoveCommand.kt @@ -5,7 +5,6 @@ import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSla import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext import com.kotlindiscord.kord.extensions.commands.application.slash.ephemeralSubCommand import com.kotlindiscord.kord.extensions.commands.converters.impl.int -import com.kotlindiscord.kord.extensions.types.respond import dev.arbjerg.lavalink.protocol.v4.Track import dev.schlaubi.mikmusic.core.MusicModule diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/NextCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/NextCommand.kt index 9d7240d3e..2cb835b4d 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/NextCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/NextCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikmusic.commands -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.checks.anyMusicPlaying import dev.schlaubi.mikmusic.core.MusicModule import dev.schlaubi.mikmusic.player.ChapterQueuedTrack diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/NowPlayingCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/NowPlayingCommand.kt index 539bb6bc5..6f24ef9dd 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/NowPlayingCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/NowPlayingCommand.kt @@ -3,7 +3,6 @@ package dev.schlaubi.mikmusic.commands import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalInt import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand -import com.kotlindiscord.kord.extensions.types.respond import dev.kord.rest.builder.message.create.embed import dev.schlaubi.mikmusic.checks.anyMusicPlaying import dev.schlaubi.mikmusic.checks.musicQuizAntiCheat diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/PauseCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/PauseCommand.kt index 52f1b0bec..95a57962f 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/PauseCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/PauseCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikmusic.commands -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.core.MusicModule suspend fun MusicModule.pauseCommand() = ephemeralControlSlashCommand { diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/QueueCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/QueueCommand.kt index 833cc87e2..cbf99503b 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/QueueCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/QueueCommand.kt @@ -1,8 +1,6 @@ package dev.schlaubi.mikmusic.commands import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.editingPaginator -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.plugin.api.util.forList import dev.schlaubi.mikmusic.checks.anyMusicPlaying import dev.schlaubi.mikmusic.core.MusicModule diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/RemoveCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/RemoveCommand.kt index 9127ee0f0..f222ff55b 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/RemoveCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/RemoveCommand.kt @@ -6,7 +6,6 @@ import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSla import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext import com.kotlindiscord.kord.extensions.commands.application.slash.ephemeralSubCommand import com.kotlindiscord.kord.extensions.commands.converters.impl.int -import com.kotlindiscord.kord.extensions.types.respond import dev.kord.common.entity.Snowflake import dev.schlaubi.mikbot.plugin.api.util.safeGuild import dev.schlaubi.mikmusic.core.MusicModule diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/ReplayCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/ReplayCommand.kt index 574aa2631..f6be7583c 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/ReplayCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/ReplayCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikmusic.commands -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.core.MusicModule suspend fun MusicModule.replayCommand() = ephemeralControlSlashCommand { diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SchedulerCommands.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SchedulerCommands.kt index 57ef9c10d..00960a308 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SchedulerCommands.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SchedulerCommands.kt @@ -1,7 +1,6 @@ package dev.schlaubi.mikmusic.commands import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.core.MusicModule import dev.schlaubi.mikmusic.player.MusicPlayer import kotlin.reflect.KMutableProperty1 diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SeekCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SeekCommand.kt index aca03f9d3..248efc35a 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SeekCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SeekCommand.kt @@ -4,7 +4,6 @@ import com.kotlindiscord.kord.extensions.DiscordRelayedException import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.string import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.checks.anyMusicPlaying import dev.schlaubi.mikmusic.core.MusicModule import kotlin.time.Duration.Companion.minutes diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SkipCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SkipCommand.kt index 9c7473c7a..7e30745f7 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SkipCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/SkipCommand.kt @@ -2,7 +2,6 @@ package dev.schlaubi.mikmusic.commands import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingInt -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.core.MusicModule class SkipArguments : Arguments() { diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/StopCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/StopCommand.kt index 6588e2002..670a16d2a 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/StopCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/StopCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikmusic.commands -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.core.MusicModule suspend fun MusicModule.stopCommand() = diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/VolumeCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/VolumeCommand.kt index 8c7883930..b994f6f1f 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/VolumeCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/commands/VolumeCommand.kt @@ -3,7 +3,6 @@ package dev.schlaubi.mikmusic.commands import com.kotlindiscord.kord.extensions.DiscordRelayedException import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalInt -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.core.MusicModule class VolumeArguments : Arguments() { diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/context/PlayMessageAction.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/context/PlayMessageAction.kt index 12af74b62..f0e40c148 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/context/PlayMessageAction.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/context/PlayMessageAction.kt @@ -2,8 +2,6 @@ package dev.schlaubi.mikmusic.context import com.kotlindiscord.kord.extensions.commands.application.message.EphemeralMessageCommandContext import com.kotlindiscord.kord.extensions.extensions.ephemeralMessageCommand -import com.kotlindiscord.kord.extensions.types.editingPaginator -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.plugin.api.util.attachmentOrContentQuery import dev.schlaubi.mikmusic.checks.joinSameChannelCheck import dev.schlaubi.mikmusic.core.MusicModule diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/DjModeCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/DjModeCommand.kt index 470d2d519..8613e36c6 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/DjModeCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/DjModeCommand.kt @@ -3,7 +3,6 @@ package dev.schlaubi.mikmusic.core.settings.commands import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalRole import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.plugin.api.settings.SettingsModule import dev.schlaubi.mikbot.plugin.api.settings.guildAdminOnly import dev.schlaubi.mikbot.plugin.api.util.safeGuild diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/FixMusicChannel.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/FixMusicChannel.kt index 15c84c516..cbcf1d35e 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/FixMusicChannel.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/FixMusicChannel.kt @@ -1,7 +1,6 @@ package dev.schlaubi.mikmusic.core.settings.commands import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.plugin.api.settings.SettingsModule import dev.schlaubi.mikbot.plugin.api.util.safeGuild import dev.schlaubi.mikmusic.core.settings.MusicSettingsDatabase diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/LeaveTimeoutCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/LeaveTimeoutCommand.kt index 5e37ce822..8b915df83 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/LeaveTimeoutCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/LeaveTimeoutCommand.kt @@ -4,7 +4,6 @@ import com.kotlindiscord.kord.extensions.DiscordRelayedException import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.duration import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.plugin.api.settings.SettingsModule import dev.schlaubi.mikbot.plugin.api.settings.guildAdminOnly import dev.schlaubi.mikbot.plugin.api.util.safeGuild diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/SchedulerSettingsCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/SchedulerSettingsCommand.kt index c74ee56c8..034e649d6 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/SchedulerSettingsCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/SchedulerSettingsCommand.kt @@ -4,7 +4,6 @@ import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalInt import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikbot.plugin.api.settings.SettingsModule import dev.schlaubi.mikbot.plugin.api.settings.guildAdminOnly import dev.schlaubi.mikbot.plugin.api.util.safeGuild diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/SponsorBlockCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/SponsorBlockCommand.kt index 092a072aa..56941f625 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/SponsorBlockCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/core/settings/commands/SponsorBlockCommand.kt @@ -3,7 +3,6 @@ package dev.schlaubi.mikmusic.core.settings.commands import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalBoolean import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.lavakord.plugins.sponsorblock.model.Category import dev.schlaubi.lavakord.plugins.sponsorblock.rest.disableSponsorblock import dev.schlaubi.lavakord.plugins.sponsorblock.rest.putSponsorblockCategories diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/AddCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/AddCommand.kt index 89fba8075..9d6caa0cf 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/AddCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/AddCommand.kt @@ -2,7 +2,6 @@ package dev.schlaubi.mikmusic.playlist.commands import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.optionalEnumChoice import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingBoolean -import com.kotlindiscord.kord.extensions.types.respond import dev.kord.rest.builder.message.create.embed import dev.schlaubi.mikmusic.autocomplete.autoCompletedYouTubeQuery import dev.schlaubi.mikmusic.player.queue.QueueOptions diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/Common.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/Common.kt index 6a463252e..ba7f63938 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/Common.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/Common.kt @@ -5,7 +5,6 @@ import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.CommandContext import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext import com.kotlindiscord.kord.extensions.commands.converters.impl.string -import com.kotlindiscord.kord.extensions.types.respond import dev.kord.core.behavior.UserBehavior import dev.schlaubi.mikbot.plugin.api.PluginContext import dev.schlaubi.mikbot.plugin.api.module.SubCommandModule diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/DeleteCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/DeleteCommand.kt index e90ad54b8..b7e0b9d2d 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/DeleteCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/DeleteCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikmusic.playlist.commands -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.playlist.PlaylistDatabase class PlaylistDeleteArguments : PlaylistArguments() diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/ListCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/ListCommand.kt index 8916a00ee..7a024a7e2 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/ListCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/ListCommand.kt @@ -2,9 +2,7 @@ package dev.schlaubi.mikmusic.playlist.commands import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingBoolean -import com.kotlindiscord.kord.extensions.types.editingPaginator -import com.kotlindiscord.kord.extensions.types.respond -import dev.schlaubi.mikbot.plugin.api.util.forFlow +import dev.schlaubi.mikbot.plugin.api.util.forList import dev.schlaubi.mikmusic.playlist.Playlist import dev.schlaubi.mikmusic.playlist.PlaylistDatabase import org.litote.kmongo.eq @@ -38,12 +36,12 @@ fun PlaylistModule.listCommand() = ephemeralSubCommand(::PlayListListArguments) } return@action } - val playlists = PlaylistDatabase.collection.find(filter).toFlow() + val playlists = PlaylistDatabase.collection.find(filter).toList() val tracks = translate("music.general.tracks") editingPaginator { - forFlow( - user, playlistCount, playlists, { "${it.name} - ${it.songs.size} $tracks by <@${it.authorId}>" }, + forList( + user, playlists, { "${it.name} - ${it.songs.size} $tracks by <@${it.authorId}>" }, { current, total -> translate( "commands.playlist.list.paginator.title", diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/LoadCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/LoadCommand.kt index a72326519..84cdb8048 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/LoadCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/LoadCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikmusic.playlist.commands -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.checks.joinSameChannelCheck import dev.schlaubi.mikmusic.playlist.PlaylistDatabase import dev.schlaubi.mikmusic.util.mapToQueuedTrack diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/RemoveCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/RemoveCommand.kt index da410ad50..6086aab45 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/RemoveCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/RemoveCommand.kt @@ -1,7 +1,6 @@ package dev.schlaubi.mikmusic.playlist.commands import com.kotlindiscord.kord.extensions.commands.converters.impl.int -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.playlist.PlaylistDatabase class PlaylistRemoveArguments : PlaylistArguments() { diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/RenameCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/RenameCommand.kt index 4a2d55215..22683331d 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/RenameCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/RenameCommand.kt @@ -1,7 +1,6 @@ package dev.schlaubi.mikmusic.playlist.commands import com.kotlindiscord.kord.extensions.commands.converters.impl.string -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.playlist.PlaylistDatabase class PlaylistRenameArguments : PlaylistArguments() { diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/SaveCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/SaveCommand.kt index b82fd8c21..cc03d5f07 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/SaveCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/SaveCommand.kt @@ -4,7 +4,6 @@ import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingBoolean import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalString import com.kotlindiscord.kord.extensions.commands.converters.impl.string -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.player.QueuedTrack import dev.schlaubi.mikmusic.player.queue.QueueOptions import dev.schlaubi.mikmusic.player.queue.findTracks diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/SongsCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/SongsCommand.kt index 1f2257ed3..22829a99a 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/SongsCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/SongsCommand.kt @@ -1,7 +1,5 @@ package dev.schlaubi.mikmusic.playlist.commands -import com.kotlindiscord.kord.extensions.types.editingPaginator -import com.kotlindiscord.kord.extensions.types.respond import dev.arbjerg.lavalink.protocol.v4.Track import dev.schlaubi.mikbot.plugin.api.util.forList import dev.schlaubi.mikmusic.util.format @@ -21,9 +19,11 @@ fun PlaylistModule.songsCommand() = ephemeralSubCommand(::PlaylistSongsArguments return@action } + val tracks = playlist.getTracks(musicPlayer.node) + editingPaginator { forList( - user, playlist.getTracks(musicPlayer.node), Track::format, + user, tracks, Track::format, { current, total -> translate( "commands.playlist.songs.paginator.title", diff --git a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/ToggleVisibilityCommand.kt b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/ToggleVisibilityCommand.kt index f2c2f401e..0a20826da 100644 --- a/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/ToggleVisibilityCommand.kt +++ b/music/commands/src/main/kotlin/dev/schlaubi/mikmusic/playlist/commands/ToggleVisibilityCommand.kt @@ -1,6 +1,5 @@ package dev.schlaubi.mikmusic.playlist.commands -import com.kotlindiscord.kord.extensions.types.respond import dev.schlaubi.mikmusic.playlist.PlaylistDatabase class PlaylistToggleVisibilityCommand : PlaylistArguments() diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/core/MusicModule.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/core/MusicModule.kt index 753a20f4a..7c18ff499 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/core/MusicModule.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/core/MusicModule.kt @@ -9,7 +9,6 @@ import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSla import com.kotlindiscord.kord.extensions.extensions.Extension import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand import com.kotlindiscord.kord.extensions.extensions.event -import com.kotlindiscord.kord.extensions.types.edit import dev.kord.common.entity.Snowflake import dev.kord.core.behavior.GuildBehavior import dev.kord.core.event.gateway.ReadyEvent diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/musicchannel/MusicChannelCommand.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/musicchannel/MusicChannelCommand.kt index 840ed96a5..5d1eef844 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/musicchannel/MusicChannelCommand.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/musicchannel/MusicChannelCommand.kt @@ -6,8 +6,6 @@ import com.kotlindiscord.kord.extensions.DiscordRelayedException import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalChannel import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand -import com.kotlindiscord.kord.extensions.types.edit -import com.kotlindiscord.kord.extensions.types.respond import dev.kord.common.annotation.KordExperimental import dev.kord.common.annotation.KordUnsafe import dev.kord.common.entity.ChannelType diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/queue/SongSearch.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/queue/SongSearch.kt index d1b68ef99..8727c63ec 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/queue/SongSearch.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/queue/SongSearch.kt @@ -15,7 +15,7 @@ import dev.schlaubi.mikbot.plugin.api.util.forList import dev.schlaubi.mikmusic.util.format import kotlin.time.Duration.Companion.minutes -typealias EditingPaginatorBuilder = suspend PaginatorBuilder.() -> Unit +typealias EditingPaginatorBuilder = PaginatorBuilder.() -> Unit typealias EditingPaginatorSender = suspend (EditingPaginatorBuilder) -> BaseButtonPaginator suspend fun CommandContext.searchSong( diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/queue/TrackFinder.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/queue/TrackFinder.kt index 4dfe21b84..d6b88541d 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/queue/TrackFinder.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/player/queue/TrackFinder.kt @@ -6,8 +6,6 @@ import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSla import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.optionalEnumChoice import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingBoolean -import com.kotlindiscord.kord.extensions.types.editingPaginator -import com.kotlindiscord.kord.extensions.types.respond import dev.arbjerg.lavalink.protocol.v4.Exception import dev.arbjerg.lavalink.protocol.v4.LoadResult import dev.kord.rest.builder.message.create.embed diff --git a/runtime/src/main/kotlin/dev/schlaubi/musicbot/core/plugin/MikbotPluginFactory.kt b/runtime/src/main/kotlin/dev/schlaubi/musicbot/core/plugin/MikbotPluginFactory.kt index ea6951f4c..5b5185e90 100644 --- a/runtime/src/main/kotlin/dev/schlaubi/musicbot/core/plugin/MikbotPluginFactory.kt +++ b/runtime/src/main/kotlin/dev/schlaubi/musicbot/core/plugin/MikbotPluginFactory.kt @@ -4,11 +4,14 @@ import dev.schlaubi.mikbot.plugin.api.PluginContext import dev.schlaubi.mikbot.plugin.api.PluginSystem import dev.schlaubi.mikbot.plugin.api.io.Database import dev.schlaubi.musicbot.core.Bot +import mu.KotlinLogging import org.pf4j.DefaultPluginFactory import org.pf4j.Plugin import org.pf4j.PluginWrapper import kotlin.reflect.typeOf +private val LOG = KotlinLogging.logger { } + class MikbotPluginFactory(private val bot: Bot) : DefaultPluginFactory() { override fun createInstance(pluginClass: Class<*>, pluginWrapper: PluginWrapper): Plugin? { val newConstructor = pluginClass.kotlin.constructors.firstOrNull { @@ -22,7 +25,7 @@ class MikbotPluginFactory(private val bot: Bot) : DefaultPluginFactory() { val context = PluginContextImpl(bot.pluginSystem, bot.database, pluginWrapper) newConstructor.call(context) as Plugin } catch (e: Exception) { - log.error("Could not instantiate plugin: ${pluginWrapper.pluginId}", e) + LOG.error("Could not instantiate plugin: ${pluginWrapper.pluginId}", e) null } }