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
## | |
# The IncludedResourceParams class is responsible for parsing a string containing | |
# a comma separated list of associated resources to include with a request. See | |
# http://jsonapi.org/format/#fetching-includes for additional details although | |
# this is not required knowledge for the task at hand. | |
# | |
# Our API requires specific inclusion of related resourses - that is we do NOT | |
# want to support wildcard inclusion (e.g. `foo.*`) | |
# | |
# The IncludedResourceParams class has three public methods making up its API. |
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
class MessengerController < Messenger::MessengerController | |
require 'rest-client' | |
def webhook | |
if fb_params.first_entry.callback.message? | |
unless params["entry"].first["messaging"][0]["message"]["is_echo"] # so the response from wit.ai won't be sent to wit.ai | |
create_user(fb_params.first_entry.sender_id) | |
message(fb_params.first_entry.callback.text, fb_params.first_entry.sender_id) | |
end | |
end |