Seeing this explosion of Pokémon happening again with the introduction of Pokémon Go, I thought it would be a cool idea to make it more convenient for someone to find out the type of a pokémon with a simple voice command.
It works by querying the PokéAPI, which requires no authentication, and returning that data to the user.
After getting the type of the pokemon from the API, it creates a sentence to display that data based on how many types the pokémon has.
Getting StartedHead to https://developer.amazon.com assuming you have an Amazon Developer Account, and create a new Alexa Skill.
The website will walk you through all the information you need, but we need to specify an intent schema, which defines all the functions our app will have. Here's what mine looks like:
{
"intents": [
{
"intent": "GetType",
"slots": [
{
"name": "pokemon",
"type": "LIST_OF_POKEMON"
}
]
}
]
}
Next, you will need to define the custom slot type, LIST_OF_POKEMON, by clicking the "Add New Slot Type" button. Put in a line seperated list of pokemon you want alexa to identify, such as the one below.
Charmander
Squirtle
Bulbasaur
Pikachu
Fill out the rest of the information such as the utterances and proceed until it asks you for a URl or ARN (if you are using AWS Lambda).
Deploying to HerokuAs it was my first time using Heroku, I followed https://devcenter.heroku.com/articles/deploying-nodejs along the way which quickly explained how to deploy my first app to heroku. I highly recommend visiting the link to get started. One challenge I faced was that my web server did not listen when deployed to Heroku, which is because I needed to create a file in the directory of my project called Procfile.txt. Inside, I put:
web: node
pokemon.js
Comments