mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-14 21:26:54 +00:00
Added kareoki. No search function though
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
module.exports ={
|
||||
name: 'kareoke',
|
||||
description: 'Sing your least-favorite song with you favorite person, me!',
|
||||
execute(message, args) {
|
||||
const axios = require('axios');
|
||||
const cheerio = require('cheerio')
|
||||
const url = args[0];
|
||||
if (args[0] == undefined) {
|
||||
message.channel.send("Please pick out a song at https://www.karaoke-lyrics.net/\nThe command should look like\n/kareoke [link_here]");
|
||||
} else {
|
||||
axios(url)
|
||||
.then(response => {
|
||||
const html = response.data;
|
||||
const $ = cheerio.load(html);
|
||||
lyrics = $('.para_row').text();
|
||||
breakbar = "---------------------------------------------";
|
||||
|
||||
message.channel.send(breakbar + "\n" + lyrics + "\n" + breakbar);
|
||||
//console.log(lyrics);
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TEST: https://www.karaoketexty.cz/texty-pisni/zoegirl/plain-170199
|
||||
Reference in New Issue
Block a user