[fix] PlayerDetector in MessageDetection not working

This commit is contained in:
liv 2020-12-28 18:59:27 -05:00 committed by GitHub
parent f180ad82db
commit 5c25c2a97d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ object MessageDetection {
} }
}, },
OTHER { OTHER {
private val regex = "^<(\\w)>".toRegex() private val regex = "^<(\\w+)>".toRegex()
override fun detect(input: CharSequence) = playerName(input) != null override fun detect(input: CharSequence) = playerName(input) != null
@ -45,7 +45,7 @@ object MessageDetection {
} }
}, },
ANY { ANY {
private val regex = "^<(\\w)>".toRegex() private val regex = "^<(\\w+)>".toRegex()
override fun detect(input: CharSequence) = input.contains(regex) override fun detect(input: CharSequence) = input.contains(regex)
@ -79,4 +79,4 @@ object MessageDetection {
BARITONE("^\\[B(aritone)?]".toRegex()), BARITONE("^\\[B(aritone)?]".toRegex()),
TPA_REQUEST("^\\w+? (has requested|wants) to teleport to you\\.".toRegex()) TPA_REQUEST("^\\w+? (has requested|wants) to teleport to you\\.".toRegex())
} }
} }