From d5cab671eeb0ffa63bca46952db9ab272f3c1233 Mon Sep 17 00:00:00 2001 From: mathieu Date: Thu, 9 Jul 2015 16:21:15 -0400 Subject: [PATCH] Add Jack help and Jack will speak anyway. #40 --- application/controllers/hooks.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/controllers/hooks.php b/application/controllers/hooks.php index 6b128eb9..e4efa46b 100644 --- a/application/controllers/hooks.php +++ b/application/controllers/hooks.php @@ -37,7 +37,7 @@ function index() $text = $this->input->post('text'); $quote = $this->quotes[rand ( 0 , 18 )]; - $result = ""; + $result["text"] = $quote; if($text === "Jack nbusers"){ @@ -51,7 +51,11 @@ function index() $result["text"] = $this->watch->count_all() . ". " . $quote; - } + }else if($text === "Jack help"){ + + $result["text"] = "Jack nbusers; Jack nbmeasures; Jack nbwatches" . ". " . $quote; + + } echo json_encode($result); }