From 7dcf5a2aff141619fb599dffc362556efddc6262 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Mon, 27 May 2013 00:34:07 -0400 Subject: [PATCH] Change SMS help command to 'commands' (issue #10) --- sms.php | 2 +- sms_hook.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sms.php b/sms.php index 1c360d0..19262f9 100644 --- a/sms.php +++ b/sms.php @@ -50,7 +50,7 @@ blockquote {
  • - Help: To get a list of commands on-the-go, just send Help (or any command not listed here). + Help: To get a list of commands on-the-go, just send Commands (or any command not listed here).
  • diff --git a/sms_hook.php b/sms_hook.php index c0f7312..b438148 100644 --- a/sms_hook.php +++ b/sms_hook.php @@ -8,6 +8,7 @@ header("content-type: text/xml"); $text = $_REQUEST['Body']; //$text = "Spoon caJun."; +$text = str_replace("?", "", $text); // ignore question marks $text = trim($text); if(strpos($text, " ") !== false) @@ -20,7 +21,7 @@ if(strlen($text) > strlen($command)) { $subject_id = getIDByLooseName($subject); } -$help = 'List of commands: "Spoon (name)" to spoon, "Status (name)" to check, "Remaining" to query number of alive spooners.'; +$help = 'List of commands:' . "\n" . '"Spoon (name)" to spoon.' . "\n" . '"Status (name)" to check.' . "\n" . '"Remaining" for number of alive spooners.'; if($subject_id == "multiple") { $response = "There are multiple " . $subject . "s in the system. Please specify last name or last initial."; @@ -37,7 +38,7 @@ if($subject_id == "multiple") { } } else if(strcasecmp($command, "remaining") == 0) { $response = "There are " . getNumActiveSpooners() . " of " . getNumTotalSpooners() . " spooners remaining."; -} else if(strcasecmp($command, "help") == 0) { +} else if(strcasecmp($command, "commands") == 0 || strcasecmp($command, "command") == 0) { $response = $help; } else { $response = "Invalid command. " . $help;