Skip to content Skip to sidebar Skip to footer

Alexa Steam Custom Skill Api Integration

currently trying to develop one of my first alexa skills. trying to build a skill that updates the user on who out of their Steam friends, are online. Curerntly it's pretty messy

Solution 1:

I have managed to solve my problem by using javascript promises. I'm completely new to promises so took some trial and error but have managed to get it to work. here is the simplest video i could find to explain the concept, it definately helped me understand how to rearrange my code.

If you wish to do two API calls in an Alexa skill, using the data from the first api call to construct and inform the second call, you will need to use promises to do them sequentially.

it took the code from the isOnline() and testGet() functions and moved them into a promise, which allowed me to complete 1 api call (the original call to get friends list info) before executing the second call (the second api to get player details based on the results of the friendslist api call)

I can now check with alexa to see which of my steam friends are online! Hopefully i'll be able to build in some more functionality (eg what they are playing, if they are offline or just away/busy/snoozing)

thanks for contributing

Post a Comment for "Alexa Steam Custom Skill Api Integration"