Name: skill-sample-nodejs-buttons-trivia
Owner: Alexa
Description: This is a sample skill using a set of built in trivia questions that will allow developers to get a head start on their trivia game skill using buttons. It allows for roll-call of the players, asking trivia questions and determining whether the voice inputs matched the answers.
Created: 2018-03-30 22:50:17.0
Updated: 2018-05-20 20:03:12.0
Pushed: 2018-05-20 20:03:11.0
Homepage: null
Size: 53
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Important: The Gadgets Skill API is in beta and is subject to change at any time without notice. We welcome your feedback.
This template offers a starting point for you to build your own Trivia Game skill featuring Echo Buttons. The template implements roll call and a game loop that handles asking and answering trivia questions. It handles receiving Echo Button events as well as animating the Echo Buttons lights.
Note You may use this template as a starting point to build your own trivia game skill. You can customize the questions list and some game parameters without making any code changes although in order to provide a unique game experience, you may have to make some code changes.
This sample skill uses:
Clone the repository.
t clone https://github.com/alexa/skill-sample-nodejs-buttons-trivia/
Initialize the ASK CLI by Navigating into the repository and running the command: ask init
and create a new profile called trivia-skill
. Follow the prompts to configure the profile and associate it with one of your AWS profiles
skill-sample-nodejs-buttons-trivia
k init
Install npm dependencies by navigating into the /lambda/custom
directory and running the npm command: npm install
lambda/custom
m install
ASK CLI will create the skill and the lambda function for you. The Lambda function will be created in the region associated with the AWS profile that you selected.
Deploy the skill and the lambda function in one step by running the following command:
k deploy -p trivia-skill
The ASK CLI automatically created a role for your lambda function to run under that can execute lambda functions and write to cloudwatch logs, but since we are using the built-in persistence of the Alexa Skills Kit for NodeJS SDK, we need to add a policy that will allow the role to create/read/write to DynamoDB
ask-lambda-*
Attach Policy
buttonAmazonDynamoDBFullAccess
, select the policy by clicking the checkbox to the left, and click the Attach Policy
button at the bottom of the page.To test, you need to login to Alexa Developer Console, and enable the “Test” switch on your skill from the “Test” Tab.
Simulate verbal interaction with your skill through the command line using the following example:
sk simulate -l en-US -p trivia-skill -t "alexa, open buttons trivia"
imulation created for simulation id: 4a7a9ed8-94b2-40c0-b3bd-fb63d9887fa7
iting for simulation response{
tatus": "SUCCESSFUL",
.
Once the “Test” switch is enabled, your skill can be tested on devices associated with the developer account as well. Speak to Alexa from any enabled device, from your browser at echosim.io, or through your Amazon Mobile App and say :
a, open buttons trivia
ge the skill name, example phrase, icons, testing instructions etc ...
mber that many information is locale-specific and must be changed for each locale (en-GB and en-US)
the Skill [Manifest Documentation](https://developer.amazon.com/docs/smapi/skill-manifest.html) for more information.
fy messages, and facts from the source code to customize the skill.
ge the model definition to replace the invocation name and the sample phrase for each intent. Repeat the operation for each locale you are planning to support.
This library is licensed under the Amazon Software License.