|
|
@ -294,6 +294,11 @@ let kara = new Vue({ |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.includesAllOf(keywords, ['roll', 'dice'])) { |
|
|
|
|
|
|
|
this.rollDice(); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.includesAllOf(keywords, ['clear', 'chat'])) { |
|
|
|
if (this.includesAllOf(keywords, ['clear', 'chat'])) { |
|
|
|
this.clearChat(); |
|
|
|
this.clearChat(); |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -447,6 +452,10 @@ let kara = new Vue({ |
|
|
|
this.startJeopardy(); |
|
|
|
this.startJeopardy(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.checkForCommands(message, 'dice')) { |
|
|
|
|
|
|
|
this.rollDice(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.lastMessage = message; |
|
|
|
this.lastMessage = message; |
|
|
|
}, |
|
|
|
}, |
|
|
|
checkForCommands(message, commands) { |
|
|
|
checkForCommands(message, commands) { |
|
|
@ -530,8 +539,6 @@ let kara = new Vue({ |
|
|
|
|
|
|
|
|
|
|
|
axios.get(url) |
|
|
|
axios.get(url) |
|
|
|
.then(function (response) { |
|
|
|
.then(function (response) { |
|
|
|
console.log(response); |
|
|
|
|
|
|
|
console.log(response.data[0].url); |
|
|
|
|
|
|
|
vue.addImageMessage({ |
|
|
|
vue.addImageMessage({ |
|
|
|
caption: '', |
|
|
|
caption: '', |
|
|
|
image: response.data[0].url |
|
|
|
image: response.data[0].url |
|
|
@ -552,8 +559,6 @@ let kara = new Vue({ |
|
|
|
|
|
|
|
|
|
|
|
axios.get(url) |
|
|
|
axios.get(url) |
|
|
|
.then(function (response) { |
|
|
|
.then(function (response) { |
|
|
|
console.log(response); |
|
|
|
|
|
|
|
console.log(response.data[0].url); |
|
|
|
|
|
|
|
vue.addImageMessage({ |
|
|
|
vue.addImageMessage({ |
|
|
|
caption: '', |
|
|
|
caption: '', |
|
|
|
image: response.data[0].url |
|
|
|
image: response.data[0].url |
|
|
@ -574,8 +579,6 @@ let kara = new Vue({ |
|
|
|
|
|
|
|
|
|
|
|
axios.get(url) |
|
|
|
axios.get(url) |
|
|
|
.then(function (response) { |
|
|
|
.then(function (response) { |
|
|
|
console.log(response); |
|
|
|
|
|
|
|
console.log(response.data[0].url); |
|
|
|
|
|
|
|
vue.addImageMessage({ |
|
|
|
vue.addImageMessage({ |
|
|
|
caption: '', |
|
|
|
caption: '', |
|
|
|
image: 'https://random.birb.pw/img/' + response.data.file |
|
|
|
image: 'https://random.birb.pw/img/' + response.data.file |
|
|
@ -675,6 +678,22 @@ let kara = new Vue({ |
|
|
|
|
|
|
|
|
|
|
|
this.updateStorage(); |
|
|
|
this.updateStorage(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
rollDice() { |
|
|
|
|
|
|
|
let dice = Math.random()*6; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dice < 1) { |
|
|
|
|
|
|
|
dice = 1; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
dice = Math.floor(dice); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.addImageMessage({ |
|
|
|
|
|
|
|
body: dice + '!', |
|
|
|
|
|
|
|
src: 'img/' + dice + '.png' |
|
|
|
|
|
|
|
}, true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.updateStorage(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// Notes
|
|
|
|
// Notes
|
|
|
|
saveNote(message) { |
|
|
|
saveNote(message) { |
|
|
|