diff --git a/build.gradle.kts b/build.gradle.kts index 7d7d2e0..6af7d8f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ plugins { kotlin("jvm") version "2.0.20" + id("org.jetbrains.dokka") version "1.9.20" kotlin("plugin.serialization") version "2.0.20" } @@ -14,6 +15,7 @@ val sqlite_version: String by project val postgres_version: String by project allprojects { + apply(plugin = "org.jetbrains.dokka") apply(plugin = "org.jetbrains.kotlin.jvm") apply(plugin = "org.jetbrains.kotlin.plugin.serialization") diff --git a/gradle.properties b/gradle.properties index 9aab5fd..2aa3ba2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ kotlin.code.style=official org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 group=net.projecttl -version=0.2.2-SNAPSHOT +version=0.2.3-SNAPSHOT ktor_version=2.3.12 log4j_version=2.23.1 diff --git a/px32-bot-core/src/main/kotlin/net/projecttl/p/x32/kernel/CoreKernel.kt b/px32-bot-core/src/main/kotlin/net/projecttl/p/x32/kernel/CoreKernel.kt index d4417bc..40ce0bc 100644 --- a/px32-bot-core/src/main/kotlin/net/projecttl/p/x32/kernel/CoreKernel.kt +++ b/px32-bot-core/src/main/kotlin/net/projecttl/p/x32/kernel/CoreKernel.kt @@ -90,14 +90,10 @@ class CoreKernel(token: String) { memLock.lock() } - val newHandlers = mutableListOf() PluginLoader.destroy() plugins.forEach { plugin -> - plugin.handlers.forEach { handler -> - if (handlers.contains(handler)) { - jda.removeEventListener(handler) - handlers.remove(handler) - } + plugin.handlers.filter { handlers.contains(it) }.map { + handlers.remove(it) } } @@ -108,15 +104,11 @@ class CoreKernel(token: String) { plugin.handlers.forEach { handler -> if (!handlers.contains(handler)) { handlers.add(handler) - newHandlers.add(handler) + jda.addEventListener(handler) } } } - handlers.map { - jda.addEventListener(it) - } - handlers.forEach { h -> if (h is CommandHandler) { h.register(jda) diff --git a/wh64@192.168.10.12 b/wh64@192.168.10.12 new file mode 100644 index 0000000..b97c2a9 Binary files /dev/null and b/wh64@192.168.10.12 differ