From 7a30d066ac08300c30747e6c76c8783044fd1d3e Mon Sep 17 00:00:00 2001 From: Logan Gorence Date: Thu, 23 Dec 2021 06:31:46 +0000 Subject: [PATCH] If token is empty (the default now), Bifrost won't do anything. - Fixes #6. --- .../kubelet/foundation/bifrost/FoundationBifrostPlugin.kt | 5 +++++ foundation-bifrost/src/main/resources/bifrost.yaml | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/foundation-bifrost/src/main/kotlin/cloud/kubelet/foundation/bifrost/FoundationBifrostPlugin.kt b/foundation-bifrost/src/main/kotlin/cloud/kubelet/foundation/bifrost/FoundationBifrostPlugin.kt index 9b0b6cc..367e045 100644 --- a/foundation-bifrost/src/main/kotlin/cloud/kubelet/foundation/bifrost/FoundationBifrostPlugin.kt +++ b/foundation-bifrost/src/main/kotlin/cloud/kubelet/foundation/bifrost/FoundationBifrostPlugin.kt @@ -42,6 +42,11 @@ class FoundationBifrostPlugin : JavaPlugin(), EventListener, Listener { ) config = Yaml.default.decodeFromStream(BifrostConfig.serializer(), configPath.inputStream()) + if (config.authentication.token.isEmpty()) { + slF4JLogger.warn("Token empty, will not start Bifrost.") + return + } + server.pluginManager.registerEvents(this, this) jda = JDABuilder diff --git a/foundation-bifrost/src/main/resources/bifrost.yaml b/foundation-bifrost/src/main/resources/bifrost.yaml index 2e440a7..3153140 100644 --- a/foundation-bifrost/src/main/resources/bifrost.yaml +++ b/foundation-bifrost/src/main/resources/bifrost.yaml @@ -1,7 +1,8 @@ # Authentication configuration for the bridge. authentication: - # Token from the Discord Bot developer's page. - token: abc123 + # Token from the Discord Bot developer's page. If this is empty, the Bifrost plugin will do + # nothing. + token: "" # Channel configuration for the bridge. channel: