@@ -35,7 +35,7 @@ import com.lambda.util.ChatUtils.slurs
3535import com.lambda.util.ChatUtils.swears
3636import com.lambda.util.ChatUtils.toAscii
3737import com.lambda.util.NamedEnum
38- import com.lambda.util.text.DirectMessage
38+ import com.lambda.util.text.MessageDirection
3939import com.lambda.util.text.MessageParser
4040import com.lambda.util.text.MessageType
4141import 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