calum / alexa-drag-race-skill Goto Github PK
View Code? Open in Web Editor NEWAlexa skill for answering questions related to drag race
Home Page: https://calum.github.io/alexa-drag-race-skill/
Alexa skill for answering questions related to drag race
Home Page: https://calum.github.io/alexa-drag-race-skill/
Currently, only supports English U.K.
It should be easy to include U.S.A.
Should probably include Brazil if possible.
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/59/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.13d73aa5-059a-4a2c-8aa6-61473c085d9a",
"timestamp": "2018-02-08T04:52:00Z",
"locale": "en-US",
"reason": "USER_INITIATED"
}
Using the list of drag race queens, build the types.json
file. This will improve Alexa's chances of translating the questions properly.
When deploying a new version amazon require these fields:
These should be set in a file which can easily be updated to make releases smoother.
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/64/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.d3b161a4-8c8b-4506-bc2f-d3cbcfa84aa2",
"timestamp": "2018-04-21T02:22:47Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/57/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.e118c30f-ee74-4cbc-8a60-89a983476821",
"timestamp": "2018-02-07T19:54:46Z",
"locale": "en-GB",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "Invalid SSML Output Speech for requestId amzn1.echo-api.request.2f3a0a73-fccc-4334-ad4f-8512b4adb9bb. Error: The audio is not of a supported MPEG version"
}
}
Tests should cover 100% of the code ideally. Write more tests to cover off any missing functions/lines of code for the following files:
src/handlers.js
src/main.js
src/drag_race/tvdb_api.js
src/drag_race/api.js
See these links to get code coverage reports:
https://codeclimate.com/github/calum/alexa-drag-race-skill/src/main.js
https://codeclimate.com/github/calum/alexa-drag-race-skill/src/handlers.js
https://codeclimate.com/github/calum/alexa-drag-race-skill/src/drag_race/tvdb_api.js
https://github.com/calum/alexa-drag-race-skill/issues/new
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/66/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.d225dd07-8b15-4670-b5aa-3a43a746e97e",
"timestamp": "2018-06-04T08:57:37Z",
"locale": "en-US",
"reason": "EXCEEDED_MAX_REPROMPTS"
}
Find a few mp3 audio files of popular quotes from Ru Paul or any of the queens and put them into the resources/
directory.
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/62/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.491b97d0-b39b-4cbc-9056-0311ebd77934",
"timestamp": "2018-02-22T00:58:18Z",
"locale": "en-CA",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/64/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.d3b161a4-8c8b-4506-bc2f-d3cbcfa84aa2",
"timestamp": "2018-04-21T02:22:47Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/60/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.15d6e0eb-f04b-492b-9f57-6c82d2674941",
"timestamp": "2018-02-08T05:27:37Z",
"locale": "en-IN",
"reason": "USER_INITIATED"
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/61/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.91928bbc-d8a9-4bc0-983d-7c358aaaa940",
"timestamp": "2018-02-08T05:29:13Z",
"locale": "en-IN",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/63/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.f35f3c4f-8d4c-4796-a03e-78f05cd7e112",
"timestamp": "2018-04-18T16:52:27Z",
"locale": "en-GB",
"reason": "EXCEEDED_MAX_REPROMPTS"
}
Request:
{
"session": {
"new": false,
"sessionId": "SessionId.78752953-f1c5-4dea-b73d-f7ccdd3a5d56",
"application": {
"applicationId": "amzn1.ask.skill.fb63dcb7-fdbf-457c-ad1e-614f084a7bfb"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AFWLHQHHME6UWKTLJR4H6UZZWZBNXIOXVXRKGAT452CANEGOU6CUTNYHOSA2IFKS7XWBDFC6JZNXSZV6FARFEUQKTWKXMLW2JVJJOOME6FWSVJCUJGWSP7RT7JEVC5AXHXDSX4UJ55MDVZJVA7XKTGKLKCLSXZEJKNTZDSRS4TCPEVRKNGIG6I26SCQCTG42JPWFJA4RRYGAVTI"
}
},
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.88e02369-fcb1-4270-ba1b-6927a2d410f6",
"intent": {
"name": "gettopthreefromseason",
"slots": {
"season_number": {
"name": "season_number",
"value": "all stars 2"
}
}
},
"locale": "en-GB",
"timestamp": "2017-10-29T10:08:17Z"
},
"context": {
"AudioPlayer": {
"playerActivity": "IDLE"
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.fb63dcb7-fdbf-457c-ad1e-614f084a7bfb"
},
"user": {
"userId": "amzn1.ask.account.AFWLHQHHME6UWKTLJR4H6UZZWZBNXIOXVXRKGAT452CANEGOU6CUTNYHOSA2IFKS7XWBDFC6JZNXSZV6FARFEUQKTWKXMLW2JVJJOOME6FWSVJCUJGWSP7RT7JEVC5AXHXDSX4UJ55MDVZJVA7XKTGKLKCLSXZEJKNTZDSRS4TCPEVRKNGIG6I26SCQCTG42JPWFJA4RRYGAVTI"
},
"device": {
"supportedInterfaces": {}
}
}
},
"version": "1.0"
}
error:
2017-10-29T10:08:18.697Z 15eccebc-bc91-11e7-9e75-07a8cae71f4c TypeError: Cannot read property 'queens' of undefined
at /var/task/src/drag_race/api.js:183:34
at Request.request.get [as _callback] (/var/task/src/drag_race/api.js:14:12)
at Request.self.callback (/var/task/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/var/task/node_modules/request/request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/var/task/node_modules/request/request.js:1085:12)
at IncomingMessage.g (events.js:292:16)
Write a node.js script and add an npm
command to build the interaction model as `build/model.json' which can be uploaded to the Alexa app's configuration site.
It should merge the configuration files: intents.json
, types.json
, prompts.json
, and dialog.json
issues are listed here: https://codeclimate.com/github/calum/alexa-drag-race-skill/issues
There should ideally never be any issues there so these are high priority.
Alexa reads undefined
{
"version": "1.0",
"response": {
"outputSpeech": {
"ssml": "<speak> Thorgy Thor has won 0 main challenges and 0 mini challenges: undefined </speak>",
"type": "SSML"
},
"speechletResponse": {
"outputSpeech": {
"ssml": "<speak> Thorgy Thor has won 0 main challenges and 0 mini challenges: undefined </speak>"
},
"shouldEndSession": true
}
},
"sessionAttributes": {}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/65/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.fd831364-3963-44b9-b71f-9b236fc8972e",
"timestamp": "2018-06-04T08:57:07Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "SpeechletResponse was null"
}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/65/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.fd831364-3963-44b9-b71f-9b236fc8972e",
"timestamp": "2018-06-04T08:57:07Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "SpeechletResponse was null"
}
}
Add a list of questions we want answered by the Alexa skill
most of these are taken from the reddit community feedback. I have no idea what some of them are...
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/58/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.566d1f15-c8df-4581-ab0e-f44688168261",
"timestamp": "2018-02-07T20:22:29Z",
"locale": "en-GB",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/60/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.15d6e0eb-f04b-492b-9f57-6c82d2674941",
"timestamp": "2018-02-08T05:27:37Z",
"locale": "en-IN",
"reason": "USER_INITIATED"
}
Pick up a question from the checklist and add it.
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/57/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.e118c30f-ee74-4cbc-8a60-89a983476821",
"timestamp": "2018-02-07T19:54:46Z",
"locale": "en-GB",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "Invalid SSML Output Speech for requestId amzn1.echo-api.request.2f3a0a73-fccc-4334-ad4f-8512b4adb9bb. Error: The audio is not of a supported MPEG version"
}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/59/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.13d73aa5-059a-4a2c-8aa6-61473c085d9a",
"timestamp": "2018-02-08T04:52:00Z",
"locale": "en-US",
"reason": "USER_INITIATED"
}
This is the last manual step which needs to be automated.
The tool can also be used to run acceptance tests before deploying.
At the moment, if a drag queen isn't recognised the user get's no response.
Request:
{
"session": {
"new": true,
"sessionId": "SessionId.433a2169-ec6a-40e4-bcb9-54556429a051",
"application": {
"applicationId": "amzn1.ask.skill.fb63dcb7-fdbf-457c-ad1e-614f084a7bfb"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AFWLHQHHME6UWKTLJR4H6UZZWZBNXIOXVXRKGAT452CANEGOU6CUTNYHOSA2IFKS7XWBDFC6JZNXSZV6FARFEUQKTWKXMLW2JVJJOOME6FWSVJCUJGWSP7RT7JEVC5AXHXDSX4UJ55MDVZJVA7XKTGKLKCLSXZEJKNTZDSRS4TCPEVRKNGIG6I26SCQCTG42JPWFJA4RRYGAVTI"
}
},
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.8cf30466-c645-42d8-b95e-441430e86574",
"intent": {
"name": "getseasonfromqueen",
"slots": {
"queen": {
"name": "queen",
"value": "is thorgy Thor"
}
}
},
"locale": "en-GB",
"timestamp": "2017-10-28T23:13:43Z"
},
"context": {
"AudioPlayer": {
"playerActivity": "IDLE"
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.fb63dcb7-fdbf-457c-ad1e-614f084a7bfb"
},
"user": {
"userId": "amzn1.ask.account.AFWLHQHHME6UWKTLJR4H6UZZWZBNXIOXVXRKGAT452CANEGOU6CUTNYHOSA2IFKS7XWBDFC6JZNXSZV6FARFEUQKTWKXMLW2JVJJOOME6FWSVJCUJGWSP7RT7JEVC5AXHXDSX4UJ55MDVZJVA7XKTGKLKCLSXZEJKNTZDSRS4TCPEVRKNGIG6I26SCQCTG42JPWFJA4RRYGAVTI"
},
"device": {
"supportedInterfaces": {}
}
}
},
"version": "1.0"
}
Response:
The remote endpoint could not be called, or the response it returned was invalid.
Error message in logs:
2017-10-28T23:13:45.566Z a46aca2d-bc35-11e7-9291-77f9ca161688 TypeError: Cannot read property 'original' of undefined
at /var/task/src/drag_race/api.js:37:46
at Request.request.get [as _callback] (/var/task/src/drag_race/api.js:14:12)
at Request.self.callback (/var/task/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/var/task/node_modules/request/request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage.<anonymous> (/var/task/node_modules/request/request.js:1085:12)
at IncomingMessage.g (events.js:292:16)
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/66/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.d225dd07-8b15-4670-b5aa-3a43a746e97e",
"timestamp": "2018-06-04T08:57:37Z",
"locale": "en-US",
"reason": "EXCEEDED_MAX_REPROMPTS"
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/61/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.91928bbc-d8a9-4bc0-983d-7c358aaaa940",
"timestamp": "2018-02-08T05:29:13Z",
"locale": "en-IN",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/58/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.566d1f15-c8df-4581-ab0e-f44688168261",
"timestamp": "2018-02-07T20:22:29Z",
"locale": "en-GB",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
At the moment they are too rubbish to publish.
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/62/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.491b97d0-b39b-4cbc-9056-0311ebd77934",
"timestamp": "2018-02-22T00:58:18Z",
"locale": "en-CA",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
At the moment, it is easy to error when asking about an all stars season
e.g.
who won all stars 2?
Request:
{
"session": {
"new": false,
"sessionId": "SessionId.f7cb34fd-5142-4b48-a6a6-dc069c759e3a",
"application": {
"applicationId": "amzn1.ask.skill.fb63dcb7-fdbf-457c-ad1e-614f084a7bfb"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AFWLHQHHME6UWKTLJR4H6UZZWZBNXIOXVXRKGAT452CANEGOU6CUTNYHOSA2IFKS7XWBDFC6JZNXSZV6FARFEUQKTWKXMLW2JVJJOOME6FWSVJCUJGWSP7RT7JEVC5AXHXDSX4UJ55MDVZJVA7XKTGKLKCLSXZEJKNTZDSRS4TCPEVRKNGIG6I26SCQCTG42JPWFJA4RRYGAVTI"
}
},
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.3d3ccb5b-5711-4940-9dde-b729df1d9556",
"intent": {
"name": "getwinnerfromseason",
"slots": {
"season_number": {
"name": "season_number",
"value": "all stars 2"
}
}
},
"locale": "en-GB",
"timestamp": "2017-10-28T23:18:24Z"
},
"context": {
"AudioPlayer": {
"playerActivity": "IDLE"
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.fb63dcb7-fdbf-457c-ad1e-614f084a7bfb"
},
"user": {
"userId": "amzn1.ask.account.AFWLHQHHME6UWKTLJR4H6UZZWZBNXIOXVXRKGAT452CANEGOU6CUTNYHOSA2IFKS7XWBDFC6JZNXSZV6FARFEUQKTWKXMLW2JVJJOOME6FWSVJCUJGWSP7RT7JEVC5AXHXDSX4UJ55MDVZJVA7XKTGKLKCLSXZEJKNTZDSRS4TCPEVRKNGIG6I26SCQCTG42JPWFJA4RRYGAVTI"
},
"device": {
"supportedInterfaces": {}
}
}
},
"version": "1.0"
}
View details in Rollbar: https://rollbar.com/calumforster/alexa-drag-race-skill/items/63/
error event{
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.f35f3c4f-8d4c-4796-a03e-78f05cd7e112",
"timestamp": "2018-04-18T16:52:27Z",
"locale": "en-GB",
"reason": "EXCEEDED_MAX_REPROMPTS"
}
When a user says Alexa, ask Drag Race Facts for a quote
we should play an mp3 audio file.
Here is an example from here:
const handlers = {
'LaunchRequest' : function() {
const speechOutput = 'Hello world!';
const behavior = 'REPLACE_ALL';
const url = 'https://url/to/audiosource';
const token = 'myMusic';
const expectedPreviousToken = 'expectedPreviousStream';
const offsetInMilliseconds = 10000;
this.response.speak(speechOutput)
.audioPlayerPlay(behavior, url, token, expectedPreviousToken, offsetInMilliseconds);
this.emit(':responseReady');
}
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.