aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/BankInterestDetection.kt13
1 files changed, 13 insertions, 0 deletions
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/BankInterestDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/BankInterestDetection.kt
index 1e8da23..fb39d87 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/BankInterestDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/BankInterestDetection.kt
@@ -17,6 +17,8 @@ class BankInterestDetection {
val bankInterestPattern =
Pattern.compile("You have just received (?<coins>$SHORT_NUMBER_PATTERN) coins as interest in your (co-op|personal) bank account!")
+ val offlineBankInterestPattern =
+ Pattern.compile("Since you've been away you earned (?<coins>$SHORT_NUMBER_PATTERN) coins as interest in your personal bank account!")
@Inject
lateinit var logger: LedgerLogger
@@ -34,5 +36,16 @@ class BankInterestDetection {
)
)
}
+ offlineBankInterestPattern.useMatcher(event.message) {
+ logger.logEntry(
+ LedgerEntry(
+ TransactionType.BANK_WITHDRAW,
+ event.timestamp,
+ listOf(
+ ItemChange.gainCoins(parseShortNumber(group("coins"))),
+ )
+ )
+ )
+ }
}
}