Skip to content

Commit

Permalink
fix: DiscordListener not respecting channel.discordsrv setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Jan 12, 2024
1 parent 7f9b12a commit f2e6773
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,10 @@ class DiscordListener {

@Subscribe(priority = ListenerPriority.NORMAL)
fun GameChatMessagePreProcessEvent.onChat() {
val data = player.toGeary().get<ChannelData>() ?: return
val channel = data.channel ?: return
val lastUsedChannel = data.lastChannelUsed ?: return
val channel = player.toGeary().get<ChannelData>()?.channel ?: return
if (!channel.discordsrv) isCancelled = true
}

// Parse the DSRV Component through the Chatty normal MM instance to format <chatty> tags, then serialize/deserialize it back to DSRV Component
private fun ComponentDSV.stripFormat(player: Player, channel: ChattyChannel): ComponentDSV =
mm.deserialize(plainText.serialize(this).replace(
plainText.serialize(
mm.deserialize(translatePlaceholders(player, channel.format).parseTags(player, true).serialize())
), ""
))

@Subscribe
fun DeathMessagePreProcessEvent.onDeath() {
if (isCancelled) return
Expand Down

0 comments on commit f2e6773

Please sign in to comment.