1
mirror of https://github.com/jakejarvis/spoons.git synced 2025-04-26 12:18:27 -04:00

Change SMS help command to 'commands' (issue #10)

This commit is contained in:
Jake Jarvis 2013-05-27 00:34:07 -04:00
parent dbe53c4a6a
commit 7dcf5a2aff
2 changed files with 4 additions and 3 deletions

View File

@ -50,7 +50,7 @@ blockquote {
</li>
<li>
<strong>Help:</strong> To get a list of commands on-the-go, just send <strong>Help</strong> (or any command not listed here).
<strong>Help:</strong> To get a list of commands on-the-go, just send <strong>Commands</strong> (or any command not listed here).
</li>
</ul>

View File

@ -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;