Created
December 10, 2011 17:14
-
-
Save monoxgas/1455623 to your computer and use it in GitHub Desktop.
This file contains 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
filter "StartRequest", direction: :from_iphone do |object| | |
puts "[Info - Button Information] #{object["properties"]}" | |
say "I don't have any #{object["properties"]["utterance"].capitalize} muffins, sorry..." #Fails Here, Logs the Say but never actually says it | |
object = false #After a while, it will google search my utterance I used | |
end | |
def createButton(text, utterance, command) | |
startRequest = SiriStartRequest.new(text, false, true) #Does the true proxyOnly parameter matter here? | |
sendCommand = SiriSendCommands.new | |
sendCommand.commands << startRequest | |
button = SiriButton.new(text) | |
button.commands << sendCommand | |
return button | |
end | |
listen_for /Button Test/i do | |
add_views = SiriAddViews.new | |
add_views.make_root(last_ref_id) | |
utterance = SiriAssistantUtteranceView.new("Choose a Muffin:") | |
add_views.views << utterance | |
add_views.views << createButton("Blueberry") | |
add_views.views << createButton("Chocolate") | |
add_views.views << createButton("Pumpkin") | |
add_views.views << createButton("Plain") | |
send_object add_views | |
request_completed | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment