mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-15 05:36: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
|
||||||
@@ -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] });
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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!");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Generated
+1190
-17
File diff suppressed because it is too large
Load Diff
+5
-1
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user