mirror of
https://github.com/ION606/selmerBot.git
synced 2026-06-05 23:06:14 +00:00
Transitioned all Misc, audio, Selmer Specific, admin, anime/manga, and inventory commands to Slash Command format. The RSS and reactionrole commands are still broken and all game commands are still in message format due to compications
This commit is contained in:
+24
-18
@@ -1,26 +1,32 @@
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports ={
|
||||
name: 'kareoke',
|
||||
description: 'Sing your least-favorite song with your favorite person, me!',
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
execute(interaction, Discord, Client, bot) {
|
||||
const arg = interaction.options.data[0].value;
|
||||
if (arg == "help") { return interaction.reply({content: "Please pick out a song at https://www.karaoke-lyrics.net/\nThe command should look like\n/kareoke [link_here]"}); }
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
const url = interaction.options.data[0].value;
|
||||
|
||||
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((err) => {
|
||||
console.log(err);
|
||||
interaction.reply("Please provide a valid url from https://www.karaoke-lyrics.net/");
|
||||
});
|
||||
},
|
||||
options: [{name: 'url', description: 'the url of the song or "help"', type: Constants.ApplicationCommandOptionTypes.STRING, required: true}]
|
||||
}
|
||||
|
||||
//TEST: https://www.karaoketexty.cz/texty-pisni/zoegirl/plain-170199
|
||||
Reference in New Issue
Block a user