Added kareoki. No search function though

This commit is contained in:
ION606
2022-03-10 20:30:03 -05:00
parent 8d1d633703
commit cdacc6c03e
6 changed files with 1261 additions and 19 deletions
+26
View File
@@ -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
+1 -1
View File
@@ -11,7 +11,7 @@ module.exports = {
.addFields( .addFields(
{name: 'My Epithets:', value: "Pearls of Wisdom"}, {name: 'My Epithets:', value: "Pearls of Wisdom"},
{name: '\t1. ', value: "Negative money is the best money"}, {name: '\t1. ', value: "Negative money is the best money"},
{name: '\t2. ', value: "Ukrane"} {name: '\t2. ', value: "There is no god, only logic"}
); );
message.channel.send({ embeds: [newEmbed] }); message.channel.send({ embeds: [newEmbed] });
+21
View File
@@ -0,0 +1,21 @@
module.exports ={
name: "scraper",
description: ".....",
execute(message, args) {
const axios = require('axios');
const cheerio = require('cheerio')
const url = args[0];
axios(url)
.then(response => {
const html = response.data;
const $ = cheerio.load(html);
lyrics = $('.para_row').text();
//message.channel.send(lyrics);
console.log(lyrics);
})
.catch(console.error);
}
}
//TEST: https://www.karaoketexty.cz/texty-pisni/zoegirl/plain-170199
+18
View File
@@ -41,6 +41,17 @@ client.on('ready', () => {
client.on('messageCreate', (message) => { client.on('messageCreate', (message) => {
/*//PREVIEW COMMANDS START
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
lib.discord.commands['@0.0.0'].create({
"name": "test",
"description": "it's a test command!",
"options": []
});
//PREVIEW COMMANDS END*/
//COMMAND AREA //COMMAND AREA
//Check if the prefix exists //Check if the prefix exists
if (!message.content.startsWith(prefix) || message.author.bot) return; if (!message.content.startsWith(prefix) || message.author.bot) return;
@@ -66,12 +77,19 @@ client.on('messageCreate', (message) => {
//case 'playaudio': client.commands.get('playaudio').execute(message, args, client, Discord); //case 'playaudio': client.commands.get('playaudio').execute(message, args, client, Discord);
//break; //break;
case 'quotes': client.commands.get('quotes').execute(message, args, Discord, Client); case 'quotes': client.commands.get('quotes').execute(message, args, Discord, Client);
break; break;
case 'extracredit': client.commands.get('EC').execute(message); case 'extracredit': client.commands.get('EC').execute(message);
break; break;
case 'scrape': client.commands.get('scraper').execute(message, args);
break;
case 'kareoke': client.commands.get('kareoke').execute(message, args);
break;
default: message.channel.send("'" + message.content + "' is not a command!"); default: message.channel.send("'" + message.content + "' is not a command!");
} }
}) })
+1190 -17
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -18,8 +18,12 @@
"homepage": "https://github.com/ION606/selmerBot#readme", "homepage": "https://github.com/ION606/selmerBot#readme",
"dependencies": { "dependencies": {
"@discordjs/voice": "^0.8.0", "@discordjs/voice": "^0.8.0",
"axios": "^0.26.1",
"cheerio": "^1.0.0-rc.10",
"discord.js": "^13.6.0", "discord.js": "^13.6.0",
"ffmpeg-static": "^4.4.1", "ffmpeg-static": "^4.4.1",
"libsodium-wrappers": "^0.7.9" "libsodium-wrappers": "^0.7.9",
"node-fetch": "2.0",
"puppeteer": "^13.5.1"
} }
} }