mirror of
				https://github.com/GayPizzaSpecifications/foundation.git
				synced 2025-11-04 03:39:37 +00:00 
			
		
		
		
	Add toggles for chat bridge.
This commit is contained in:
		@ -66,6 +66,7 @@ class FoundationBifrostPlugin : JavaPlugin(), EventListener, Listener {
 | 
				
			|||||||
        onDiscordReady()
 | 
					        onDiscordReady()
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      is MessageReceivedEvent -> {
 | 
					      is MessageReceivedEvent -> {
 | 
				
			||||||
 | 
					        if (!config.channel.bridge) return
 | 
				
			||||||
        // Prevent this bot from receiving its own messages and creating a feedback loop.
 | 
					        // Prevent this bot from receiving its own messages and creating a feedback loop.
 | 
				
			||||||
        if (e.author.id == jda.selfUser.id) return
 | 
					        if (e.author.id == jda.selfUser.id) return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -121,6 +122,7 @@ class FoundationBifrostPlugin : JavaPlugin(), EventListener, Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  @EventHandler
 | 
					  @EventHandler
 | 
				
			||||||
  private fun onPlayerChat(e: AsyncChatEvent) {
 | 
					  private fun onPlayerChat(e: AsyncChatEvent) {
 | 
				
			||||||
 | 
					    if (!config.channel.bridge) return
 | 
				
			||||||
    val channel = getChannel() ?: return
 | 
					    val channel = getChannel() ?: return
 | 
				
			||||||
    val message = e.message()
 | 
					    val message = e.message()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -16,6 +16,7 @@ data class BifrostAuthentication(
 | 
				
			|||||||
@Serializable
 | 
					@Serializable
 | 
				
			||||||
data class BifrostChannel(
 | 
					data class BifrostChannel(
 | 
				
			||||||
  val id: String,
 | 
					  val id: String,
 | 
				
			||||||
 | 
					  val bridge: Boolean = true,
 | 
				
			||||||
  val sendStart: Boolean = true,
 | 
					  val sendStart: Boolean = true,
 | 
				
			||||||
  val sendShutdown: Boolean = true,
 | 
					  val sendShutdown: Boolean = true,
 | 
				
			||||||
  val sendPlayerJoin: Boolean = true,
 | 
					  val sendPlayerJoin: Boolean = true,
 | 
				
			||||||
 | 
				
			|||||||
@ -9,6 +9,9 @@ channel:
 | 
				
			|||||||
  # then be copied by right-clicking the channel and selecting "Copy ID".
 | 
					  # then be copied by right-clicking the channel and selecting "Copy ID".
 | 
				
			||||||
  id: 123456789
 | 
					  id: 123456789
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Toggles the chat message bridge.
 | 
				
			||||||
 | 
					  bridge: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Toggles for common events that generate notifications that are sent to the channel.
 | 
					  # Toggles for common events that generate notifications that are sent to the channel.
 | 
				
			||||||
  sendStart: true
 | 
					  sendStart: true
 | 
				
			||||||
  sendShutdown: true
 | 
					  sendShutdown: true
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user