aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/features')
-rw-r--r--src/main/kotlin/com/dulkirfabric/features/chat/AbiPhoneDND.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/chat/AbiPhoneDND.kt b/src/main/kotlin/com/dulkirfabric/features/chat/AbiPhoneDND.kt
index 2172c4b..52224ff 100644
--- a/src/main/kotlin/com/dulkirfabric/features/chat/AbiPhoneDND.kt
+++ b/src/main/kotlin/com/dulkirfabric/features/chat/AbiPhoneDND.kt
@@ -18,7 +18,7 @@ object AbiPhoneDND {
if (!DulkirConfig.configOptions.abiPhoneDND) return
if (System.currentTimeMillis() - lastRing < 5000) {
if (event.sound.id.path == "block.note_block.pling" && event.sound.volume == 0.69f && event.sound.pitch == 1.6666666f) {
- event.isCancelled = true
+ event.cancel()
}
}
}
@@ -26,11 +26,10 @@ object AbiPhoneDND {
@EventHandler
fun handle(event: ChatReceivedEvent) {
if (!DulkirConfig.configOptions.abiPhoneDND) return
- val unformatted: String = event.message.unformattedString
- println(unformatted)
+ val unformatted = event.message.unformattedString
if (unformatted matches abiPhoneFormat && !unformatted.contains("Elle") && !unformatted.contains("Dean")) {
val matchResult = abiPhoneFormat.find(unformatted)
- event.isCancelled = true
+ event.cancel()
lastRing = System.currentTimeMillis()
if (DulkirConfig.configOptions.abiPhoneCallerID) {
val blocked = if (Math.random() < .001) "Breefing"
@@ -39,8 +38,9 @@ object AbiPhoneDND {
}
}
if (unformatted.startsWith("✆ Ring...") && unformatted.endsWith("[PICK UP]")
- && System.currentTimeMillis() - lastRing < 5000) {
- event.isCancelled = true
+ && System.currentTimeMillis() - lastRing < 5000
+ ) {
+ event.cancel()
}
}
} \ No newline at end of file