diff --git a/app.js b/app.js index b504870..4d9f22a 100644 --- a/app.js +++ b/app.js @@ -282,6 +282,23 @@ let kara = new Vue({ return false; } + if (this.includesAllOf(keywords, ['play']) && + this.includesOneOf(keywords, ['quiz', 'trivia']) + ) { + this.startQuiz(); + return false; + } + + if (this.includesAllOf(keywords, ['play', 'jeopardy'])) { + this.startJeopardy(); + return false; + } + + if (this.includesAllOf(keywords, ['clear', 'chat'])) { + this.clearChat(); + return false; + } + if (this.includesAllOf(keywords, ['weather']) && this.includesOneOf(keywords, ['how', 'whats']) ) { @@ -423,7 +440,7 @@ let kara = new Vue({ } if (this.checkForCommands(message, 'quiz')) { - this.getRandomTriviaQuestion(); + this.startQuiz(); } if (this.checkForCommands(message, 'jeopardy')) { @@ -614,7 +631,7 @@ let kara = new Vue({ this.updateStorage(); }, - getRandomTriviaQuestion() { + startQuiz() { let vue = this; let url = 'https://jservice.io/api/random';