diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt b/common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt index fe2f4cc..35af1f6 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt @@ -155,6 +155,7 @@ fun startAstralbot(server: MinecraftServer) { fun stopAstralbot() { LOGGER.info("Shutting down AstralBot") shuttingDown.set(true) + minecraftHandler?.close() if (baseDirectory != null) FAQHandler.stop() if (jda != null) { jda!!.shutdown() diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt b/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt index 985e14b..07951eb 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/handlers/MinecraftHandler.kt @@ -490,4 +490,8 @@ class MinecraftHandler(private val server: MinecraftServer) : ListenerAdapter() private fun useWebhooks(): Boolean { return AstralBotConfig.WEBHOOK_ENABLED.get() && webhookClient != null } + + fun close() { + webhookClient?.close() + } } \ No newline at end of file