Sunday 23 July 2017

Request within a request - How to 'wait' for all requests to be made before continuing.

Hey y'all, I know this goes a bit against the non-blocking stuff - so maybe I can clarify here.I've got a bot I'm working on that when asked for info, he will return a parsed JSON into the chat all nice-like.So fist thing is it makes a request, gets the JSON back - now one of the fields is another link to the api - so instead of publishing that string, I'd like for it to make a request from that url, when that returns, it'll grab the property I need, then return all the info back for the bot.reply() to handle.Here's the first request - Someone asks the bot 'I'd like to know about X' http://ift.tt/2vyKlg6 you can see, the spouses property returns the url, I'd like to make a second request using that url and merge all that info back for bot.reply() to use in it's message.

Submitted July 23, 2017 at 06:57PM by TubaSpoof

No comments:

Post a Comment