Bring back platform specific response getters?


As I am working through new unit testing for Jovo V2, I find myself longing for the getters that J1 used to have. For Example:

Alexa: getDirectives(), hasStandardCard() , hasSimpleCard(),

Google: hasImageCard(), hasBasicCard()

For now I can dig into the response and get the info, but I would still like to see these make a comeback. Anyone else feel the same? Any plans to already do this perhaps?


It’s on the list.

PRs appreciated :wink:


Ok guys, I am working on these and wondering how to handle adding info to documentation. Should I add a new “Platform Specific Methods” section here: ?

Or add a section about it to ?


That’s great! :raised_hands:
I think a “Platform Specific Methods” section on the response page makes sense!


Great, thanks so much!!


Thanks a lot for this great Pull Request, @natrixx :pray:


You’re welcome!

I think next up I will add some for google:


Any other suggestions to add to the list are welcome! :smile:


What about hasMediaResponse() and getMediaResponse() ?

Not really needed now, but maybe useful in the future.

and all the other askFor methods

Thanks again, Nate!


No problemo! These are all good ones too, I will get them on the list!


@AlexSwe - As I start getting setup to work on these, I started to wonder something. The fix I made for hasState was corrected in DialogflowResponse.ts.

But while digging around, I found that getSpeech for example seems to route/end up at GoogleActionResponse.ts.

So basically, where would you prefer these new methods go, and why? :slight_smile:


Oh yes, haha, that’s the difficulty of the Dialogflow/Google Action relationship.

Google Assistant doesn’t do session handling, so anything related to session data, state etc. would go into Dialogflow, which handles it for Google Assistant. Anything Google Action specific (inside the custom google payload (see here in the Google docs) would go into GoogleActionResponse.ts.

Hope this helps!


Perfect, thanks abunch!! :+1: