Last active
November 22, 2016 18:39
-
-
Save ObjectIsAdvantag/92b50fb9fbaa3e43455dc6691c4f93c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
say("Thank you for calling the random strategies hotline"); | |
ask("Please enter your phone number followed by the pound sign", { | |
choices: "[9-12 DIGITS]", | |
terminator: "#", | |
mode: "dtmf", | |
onChoice: function(event) { | |
var quote = pickRandomQuote (); | |
message(quote, { | |
to: event.value, | |
network: "SMS" | |
}); | |
say("Your message has been sent to +" + event.value); | |
hangup(); | |
}, | |
onBadChoice: function(event) { | |
say("Sorry, your entry is not a valid number. Goodbye"); | |
} | |
}); | |
function pickRandomQuote(){ | |
var quotes = [ | |
"Speech was given to man to disguise his thoughts.", | |
"The adjective is the banana peel of the parts of speech." | |
]; | |
return quotes[Math.floor(Math.random() * quotes.length)]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment