bespoken / virtual-alexa

:robot: Easily test and debug Alexa skills programmatically
https://bespoken.io
Apache License 2.0
112 stars 35 forks source link

Alexa code in Google Cloud #95

Closed AngavaiS closed 5 years ago

AngavaiS commented 5 years ago

Hello,

We have migrated our Alexa aws code to Google Cloud. Can you please help me how to initialize ?

.handler('./src/AlexaSkill.LaunchRequestHandler') .applicationID('https://alexa-dev.cloudfunctions.net/mapp') .interactionModelFile('./model.json') .create();

describe('Launch Intent', () => { it('Returns the correct prompt', async () => { const result = await alexa.launch(); console.log(result); //const result = await alexa.utter('ask mybeta'); }); });

I am getting the following error: 1) Launch Intent Returns the correct prompt: TypeError: lambdaFunction is not a function

Thanks, Angavai S.

jperata commented 5 years ago

Hi, this error refers to the specified handler not being a function. Could you verify the path and the function name are correct? Also the function needs to be exported. If none of those are the issues, please share a small snippet of how LaunchRequestHandler is declared , it may be that you have another exported function that includes all handlers and that is the one that needs to be called

AngavaiS commented 5 years ago

@jperata , Thanks a lot. Since we moved the code to Google, I followed the below and its working fine now. const alexa = va.VirtualAlexa.Builder() .intentSchemaFile('./src/intentschema.json') .skillURL('https://dev.net/map') .interactionModelFile('./src/interaction-model.json') .create();