Browse Source

Readd command not found with extra flag; add /66

master
Nero 5 years ago
parent
commit
fcf235c9ce
  1. 29
      app.js

29
app.js

@ -425,27 +425,35 @@ let kara = new Vue({
// Commands // Commands
processCommands: function (message) { processCommands: function (message) {
let commandExecuted = false;
if (this.checkForCommands(message, 'todo')) { if (this.checkForCommands(message, 'todo')) {
let todoToSave = this.checkForCommands(message, 'todo'); let todoToSave = this.checkForCommands(message, 'todo');
this.saveTodo(todoToSave); this.saveTodo(todoToSave);
commandExecuted = true;
} }
if (this.checkForCommands(message, 'clear')) { if (this.checkForCommands(message, 'clear')) {
this.clearChat(); this.clearChat();
commandExecuted = true;
} }
if (this.checkForCommands(message, 'weather')) { if (this.checkForCommands(message, 'weather')) {
this.checkWeather(); this.checkWeather();
commandExecuted = true;
} }
if (this.checkForCommands(message, 'joke')) { if (this.checkForCommands(message, 'joke')) {
this.tellJoke(this.checkForCommands(message, 'joke')); this.tellJoke(this.checkForCommands(message, 'joke'));
commandExecuted = true;
} }
if (this.checkForCommands(message, 'meme')) { if (this.checkForCommands(message, 'meme')) {
this.getRandomMeme(this.checkForCommands(message, 'meme')); this.getRandomMeme(this.checkForCommands(message, 'meme'));
commandExecuted = true;
} else if (this.checkForCommands(message, 'me ')) { } else if (this.checkForCommands(message, 'me ')) {
this.meMessage(this.checkForCommands(message, 'me ')); this.meMessage(this.checkForCommands(message, 'me '));
commandExecuted = true;
} }
let animals = [ let animals = [
@ -461,41 +469,60 @@ let kara = new Vue({
animals.forEach((animal) => { animals.forEach((animal) => {
if (this.checkForCommands(message, animal.animal + 'Img')) { if (this.checkForCommands(message, animal.animal + 'Img')) {
this.rsaRandomAnimalImage(animal.animal, animal.emoji); this.rsaRandomAnimalImage(animal.animal, animal.emoji);
commandExecuted = true;
} }
if (this.checkForCommands(message, animal.animal + 'Fact')) { if (this.checkForCommands(message, animal.animal + 'Fact')) {
this.rsaRandomAnimalFact(animal.animal, animal.emoji); this.rsaRandomAnimalFact(animal.animal, animal.emoji);
commandExecuted = true;
} }
}); });
animals.forEach((animal) => { animals.forEach((animal) => {
if (this.checkForCommands(message, animal.animal)) { if (this.checkForCommands(message, animal.animal)) {
this.rsaRandomAnimalImage(animal.animal, animal.emoji); this.rsaRandomAnimalImage(animal.animal, animal.emoji);
commandExecuted = true;
} }
}); });
if (this.checkForCommands(message, 'lyrics')) { if (this.checkForCommands(message, 'lyrics')) {
this.rsaLyrics(this.checkForCommands(message, 'lyrics')); this.rsaLyrics(this.checkForCommands(message, 'lyrics'));
commandExecuted = true;
} }
if (this.checkForCommands(message, 'quiz')) { if (this.checkForCommands(message, 'quiz')) {
this.startQuiz(); this.startQuiz();
commandExecuted = true;
} }
if (this.checkForCommands(message, 'jeopardy')) { if (this.checkForCommands(message, 'jeopardy')) {
this.startJeopardy(); this.startJeopardy();
commandExecuted = true;
} }
if (this.checkForCommands(message, 'dice')) { if (this.checkForCommands(message, 'dice')) {
this.rollDice(); this.rollDice();
commandExecuted = true;
} }
if (this.checkForCommands(message, 'talk')) { if (this.checkForCommands(message, 'talk')) {
this.talk = !this.talk; this.talk = !this.talk;
commandExecuted = true;
} }
if (this.checkForCommands(message, 'say')) { if (this.checkForCommands(message, 'say')) {
this.botMessage(this.checkForCommands(message, 'say')) this.botMessage(this.checkForCommands(message, 'say'));
commandExecuted = true;
}
if (this.checkForCommands(message, '66')) {
this.botMessage("But the children..");
commandExecuted = true;
}
if (!commandExecuted) {
this.isTyping = false;
this.botMessage("I can't find that command, sorry. 😖");
} }
this.lastMessage = message; this.lastMessage = message;

Loading…
Cancel
Save