Skip to content

Commit

Permalink
fix: only send baseMessage to discord
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Jan 28, 2024
1 parent f9c0436 commit 58f4dd6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class DiscordListener {
@Subscribe(priority = ListenerPriority.NORMAL)
fun GameChatMessagePreProcessEvent.onChat() {
val channel = player.toGeary().get<ChannelData>()?.channel ?: return
val filteredMessage = handleChatFilters(messageComponent.toComponent(), player, null)?.toComponentDSV()
val baseMessage = messageComponent.children().last().toComponent()
val filteredMessage = handleChatFilters(baseMessage, player, null)?.toComponentDSV()

if (!channel.discordsrv || filteredMessage == null) isCancelled = true
else messageComponent = filteredMessage
Expand Down

0 comments on commit 58f4dd6

Please sign in to comment.