dispatchAlexaRequest: Dispatch Alexa Request to Handlers

Description Usage Arguments Details

View source: R/dispatch.R

Description

A convenience function that routes an incoming plumber request to the appropriate handler given the request's type.

Usage

1
2
dispatchAlexaRequest(req, intent = function(name, slots, attributes, ...) { },
  launch = function(...) { }, end = function(attributes, ...) { })

Arguments

req

The plumber request to dispatch on.

intent

The function to invoke if the request is of type IntentRequest.

launch

The function to invoke if the request is of type LaunchRequest.

end

The function to invoke if the request is of type SessionEndedRequest.

Details

Any of the three parameters that are not provided will just function as no-ops.

See https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/custom-standard-request-types-reference for complete details on the three intent types.

All provided handlers should accept ... as this API is subject to change and new arguments may be added. Having your handler functions accept ... is a way of ensuring that they won't break if/when alexar begins passing in new parameters that your code doesn't recognize or use.


jhudsl/alexar documentation built on May 3, 2019, 3 p.m.