Browse Source

Add chat-interactions for new games;

master
Nero Ignis 5 years ago
parent
commit
9ba484af2c
  1. 21
      app.js

21
app.js

@ -282,6 +282,23 @@ let kara = new Vue({
return false; 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']) && if (this.includesAllOf(keywords, ['weather']) &&
this.includesOneOf(keywords, ['how', 'whats']) this.includesOneOf(keywords, ['how', 'whats'])
) { ) {
@ -423,7 +440,7 @@ let kara = new Vue({
} }
if (this.checkForCommands(message, 'quiz')) { if (this.checkForCommands(message, 'quiz')) {
this.getRandomTriviaQuestion(); this.startQuiz();
} }
if (this.checkForCommands(message, 'jeopardy')) { if (this.checkForCommands(message, 'jeopardy')) {
@ -614,7 +631,7 @@ let kara = new Vue({
this.updateStorage(); this.updateStorage();
}, },
getRandomTriviaQuestion() { startQuiz() {
let vue = this; let vue = this;
let url = 'https://jservice.io/api/random'; let url = 'https://jservice.io/api/random';

Loading…
Cancel
Save