From: Cameron Ball Date: Mon, 30 Dec 2019 06:22:29 +0000 (+0800) Subject: Fix regex for internet bill and update splitBill since it's just lil Cammy now X-Git-Url: http://git.cameron1729.xyz/?p=SonOfLokstallBot.git;a=commitdiff_plain;h=1f3bc62a4a912bd7f5a7c0798667c4aeb44fc33c Fix regex for internet bill and update splitBill since it's just lil Cammy now --- diff --git a/src/common.php b/src/common.php index fb00126..36e8f42 100644 --- a/src/common.php +++ b/src/common.php @@ -54,7 +54,7 @@ function getTelegram(): TelegramAPI { } function splitBill(float $amount) : float { - return floor($amount/2); + return $amount; } function identity($x) { diff --git a/src/rules.php b/src/rules.php index 10a2110..8f57393 100644 --- a/src/rules.php +++ b/src/rules.php @@ -15,7 +15,7 @@ return [ ], 'Internet' => [ 'imapQuery' => 'FROM "@online.telstra.com"', - 'regex' => '/Total \$(?[0-9]+(\.[0-9]{2})?).*?Due Date (?\d{1,2} \w{3} \d{4})/', + 'regex' => '/Total.*?\$(?[0-9]+(\.[0-9]{2})?).*?Due Date.*?(?\d{1,2} \w{3} \d{4})/', 'messageTransform' => ∘(glue(" "), map('trim'), lines, 'strip_tags', 'html_entity_decode') ], 'Gas' => [