mirror of
https://github.com/GayPizzaSpecifications/foundation.git
synced 2025-08-02 13:10:55 +00:00
Add toggles for chat bridge.
This commit is contained in:
parent
b8c8097f58
commit
795e99ad4f
@ -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()
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user