From 1637b5541fa363d670036ca38ac3a3621fa82bb5 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Sun, 22 Jul 2018 02:16:25 +0530 Subject: [PATCH] Add conditions to add to db. --- webhook.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/webhook.php b/webhook.php index 6bd0228..d6422d0 100644 --- a/webhook.php +++ b/webhook.php @@ -1,5 +1,4 @@ {"message"}->{"text"})){ $text = $decoded->{"message"}->{"text"}; +if (substr_count($text, " was completely clueless. Village was successfully pillaged. You feel pleased about yourself.") == 1){ + add_to_db(1); +} +elseif (substr_count($text, "noticed you and nearly beat you to death.") == 1){ + add_to_db(0); +} +elseif (substr_count($text, "tried stopping you, but you were stronger.") == 1){ + add_to_db(0); +} ?>