Skip to content

Commit 2f2159a

Browse files
committed
Update AntiSpam.kt
1 parent b67bcaa commit 2f2159a

File tree

1 file changed

+6
-6
lines changed
  • src/main/kotlin/com/lambda/module/modules/chat

1 file changed

+6
-6
lines changed

src/main/kotlin/com/lambda/module/modules/chat/AntiSpam.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import com.lambda.util.ChatUtils.slurs
3535
import com.lambda.util.ChatUtils.swears
3636
import com.lambda.util.ChatUtils.toAscii
3737
import com.lambda.util.NamedEnum
38-
import com.lambda.util.text.DirectMessage
38+
import com.lambda.util.text.MessageDirection
3939
import com.lambda.util.text.MessageParser
4040
import com.lambda.util.text.MessageType
4141
import net.minecraft.text.Text
@@ -79,13 +79,13 @@ object AntiSpam : Module(
7979
}
8080

8181
init {
82-
listen<ChatEvent.Receive> { event ->
82+
listen<ChatEvent.Message> { event ->
8383
var raw = event.message.string
8484
val author = MessageParser.playerName(raw)
8585

8686
if (
87-
ignoreSystem && !MessageType.Both.matches(raw) && !DirectMessage.Both.matches(raw) ||
88-
ignoreDms && DirectMessage.Receive.matches(raw)
87+
ignoreSystem && !MessageType.Both.matches(raw) && !MessageDirection.Both.matches(raw) ||
88+
ignoreDms && MessageDirection.Receive.matches(raw)
8989
) return@listen
9090

9191
val slurMatches = slurs.takeIf { detectSlurs.enabled }.orEmpty().flatMap { it.findAll(raw).toList().reversed() }
@@ -102,8 +102,8 @@ object AntiSpam : Module(
102102
fun doMatch(replace: ReplaceConfig, matches: Sequence<MatchResult>) {
103103
if (
104104
cancelled ||
105-
filterSystem && !MessageType.Both.matches(raw) && !DirectMessage.Both.matches(raw) ||
106-
filterDms && DirectMessage.Receive.matches(raw) ||
105+
filterSystem && !MessageType.Both.matches(raw) && !MessageDirection.Both.matches(raw) ||
106+
filterDms && MessageDirection.Receive.matches(raw) ||
107107
filterFriends && author?.let { FriendManager.isFriend(it) } == true ||
108108
filterSelf && MessageType.Self.matches(raw)
109109
) return

0 commit comments

Comments
 (0)