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 9e876b7..9b0b6cc 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 @@ -66,6 +66,7 @@ class FoundationBifrostPlugin : JavaPlugin(), EventListener, Listener { onDiscordReady() } is MessageReceivedEvent -> { + if (!config.channel.bridge) return // Prevent this bot from receiving its own messages and creating a feedback loop. if (e.author.id == jda.selfUser.id) return @@ -121,6 +122,7 @@ class FoundationBifrostPlugin : JavaPlugin(), EventListener, Listener { @EventHandler private fun onPlayerChat(e: AsyncChatEvent) { + if (!config.channel.bridge) return val channel = getChannel() ?: return val message = e.message() diff --git a/foundation-bifrost/src/main/kotlin/cloud/kubelet/foundation/bifrost/model/BifrostConfig.kt b/foundation-bifrost/src/main/kotlin/cloud/kubelet/foundation/bifrost/model/BifrostConfig.kt index 40464e3..35abfec 100644 --- a/foundation-bifrost/src/main/kotlin/cloud/kubelet/foundation/bifrost/model/BifrostConfig.kt +++ b/foundation-bifrost/src/main/kotlin/cloud/kubelet/foundation/bifrost/model/BifrostConfig.kt @@ -16,6 +16,7 @@ data class BifrostAuthentication( @Serializable data class BifrostChannel( val id: String, + val bridge: Boolean = true, val sendStart: Boolean = true, val sendShutdown: Boolean = true, val sendPlayerJoin: Boolean = true, diff --git a/foundation-bifrost/src/main/resources/bifrost.yaml b/foundation-bifrost/src/main/resources/bifrost.yaml index 13384f4..2e440a7 100644 --- a/foundation-bifrost/src/main/resources/bifrost.yaml +++ b/foundation-bifrost/src/main/resources/bifrost.yaml @@ -9,6 +9,9 @@ channel: # then be copied by right-clicking the channel and selecting "Copy ID". id: 123456789 + # Toggles the chat message bridge. + bridge: true + # Toggles for common events that generate notifications that are sent to the channel. sendStart: true sendShutdown: true