|
|
|
@ -468,6 +468,10 @@ let kara = new Vue({
@@ -468,6 +468,10 @@ let kara = new Vue({
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (this.checkForCommands(message, 'lyrics')) { |
|
|
|
|
this.rsaLyrics(this.checkForCommands(message, 'lyrics')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.checkForCommands(message, 'quiz')) { |
|
|
|
|
this.startQuiz(); |
|
|
|
|
} |
|
|
|
@ -728,6 +732,26 @@ let kara = new Vue({
@@ -728,6 +732,26 @@ let kara = new Vue({
|
|
|
|
|
vue.botMessage(response.data.fact); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
rsaLyrics(searchFor) { |
|
|
|
|
let vue = this; |
|
|
|
|
|
|
|
|
|
axios.post('/api/curlJson', { |
|
|
|
|
url: 'https://some-random-api.ml/lyrics/?title=' + searchFor.replace(' ', '%20') |
|
|
|
|
}) |
|
|
|
|
.catch((error) => { |
|
|
|
|
vue.botMessage("Hmm.. i just can't remember the lyrics, but i love that song! 🎵🎧"); |
|
|
|
|
}) |
|
|
|
|
.then((response) => { |
|
|
|
|
vue.addImageMessage({ |
|
|
|
|
body: "Here you go!<br>" + |
|
|
|
|
"<br>" + |
|
|
|
|
response.data.title + ' from ' + response.data.author + '<br>' + |
|
|
|
|
'<br>' + |
|
|
|
|
response.data.lyrics, |
|
|
|
|
src: response.data.thumbnail.genius |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// LocalStorage
|
|
|
|
|
getSavedData() { |
|
|
|
|