Setup...again

This commit is contained in:
ION606
2022-04-14 13:25:01 -04:00
parent b8ce2b8c68
commit 4ca09e072a
18 changed files with 874 additions and 1393 deletions
+27 -10
View File
@@ -6,15 +6,32 @@ const { VoiceConnectionStatus, AudioPlayerStatus } = require('@discordjs/voice')
module.exports = {
name: "playaudio",
execute(message, args, client) {
const channel = "930148609406685227";
//console.log(generateDependencyReport());
connection.on(VoiceConnectionStatus.Ready, (oldState, newState) => {
console.log('Connection is in the Ready state!');
});
const connection = joinVoiceChannel({
channelId: channel,
guildId: channel.guild,
adapterCreator: channel.guild.voiceAdapterCreator,
});
message.channel.send("This command has not been set up yet\nSorry!");
return;
// //const guild = client.guilds.cache.get(client.guild.id);
// const channel = client.guilds.channels.cache.get('930148609406685227');
// channel.join()
// .then(connection => console.log('Connected'))
// .catch(console.error);
// const { createAudioResource, createAudioPlayer } = require('@discordjs/voice');
// const player = createAudioPlayer();
// const resource = createAudioResource('/home/user/voice/music.mp3', {
// metadata: {
// title: 'A good song!',
// },
// });
// // Not recommended - listen to errors from the audio player instead for most usecases!
// resource.playStream.on('error', error => {
// console.error('Error:', error.message, 'with track', resource.metadata.title);
// });
// player.play(resource);
}
}
+2 -2
View File
@@ -75,8 +75,8 @@ client.on('messageCreate', (message) => {
case 'arrow': client.commands.get('arrow').execute(message, args, Discord);
break;
//case 'playaudio': client.commands.get('playaudio').execute(message, args, client, Discord);
//break;
case 'playaudio': client.commands.get('playaudio').execute(message, args, client, Discord);
break;
case 'quotes': client.commands.get('quotes').execute(message, args, Discord, Client);
break;
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -1,7 +1,17 @@
{
"dependencies": {
"@discordjs/opus": "github:discordjs/opus",
"@discordjs/voice": "^0.8.0",
"apt": "^0.0.2",
"discord.js": "^13.6.0",
"ffmpeg": "^0.0.4",
"ffmpeg-static": "^5.0.0",
"node.js": "^0.0.1-security",
"sudo": "^1.0.3"
},
"name": "selmerbot",
"description": "Authors: ION606, MajorDrools",
"version": "1.0.0",
"description": "THEEEEEE SEEELMEEEERRR BOOOOOOOOTTTTTT",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
@@ -15,15 +25,5 @@
"bugs": {
"url": "https://github.com/ION606/selmerBot/issues"
},
"homepage": "https://github.com/ION606/selmerBot#readme",
"dependencies": {
"@discordjs/voice": "^0.8.0",
"axios": "^0.26.1",
"cheerio": "^1.0.0-rc.10",
"discord.js": "^13.6.0",
"ffmpeg-static": "^4.4.1",
"libsodium-wrappers": "^0.7.9",
"node-fetch": "2.0",
"puppeteer": "^13.5.1"
}
"homepage": "https://github.com/ION606/selmerBot#readme"
}
-3
View File
@@ -1,3 +0,0 @@
config.json
.env
node_modules
-6
View File
@@ -1,6 +0,0 @@
# selmerBot
Created by ION606
Description:
This is a bot modeled after Selmer Bringjord of RPI and all the wonderful things he says
Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 KiB

-47
View File
@@ -1,47 +0,0 @@
module.exports = {
name: 'EC',
description: "Selmer Bot Dm's you for some *AHEM* extra credit",
execute(message) {
let dm;
let num = Math.floor(Math.random() * 10);
switch(num) {
case 0: dm = 'Hello there, let me show you some...logic';
break;
case 1: dm = 'I think the sexiest part of a person is their brain';
break;
case 2: dm = 'Hey babe, wanna make some negative money?';
break;
case 3: dm = 'The AI is coming for you! Buy my book to find out how to stop them!';
break;
case 4: dm = 'Did you know I proved P=NP. The proof is on my password-encrypted tablet.\nPretty safe there I reckon';
break;
case 5: dm = 'I hate informal logic, but there\'s nothing informal about you!';
break;
case 6: dm = 'My book "A Modern Approach; Beginning Deductive Logic via HyperSlate®, Advanced" is now available online!';
break;
case 7: dm = 'HyperSlate is a flawless creation. I should know, I made it myself!';
break;
case 8: dm = 'Could a Robot Be a Bona Fide Hero? I think not! He\'s not me, after all!';
break;
case 9: dm = "Warning: Increasingly, the term reasoning is used by some who dont really do anything related to reasoning, as traditionally understood, to nonetheless label what they do. Fortunately, its easy to verify that some reasoning is that which is covered by formal logic: If the reasoning is explicit; links declarative statements or formulae together via explicit, abstract reasoning schemata or rules of inference (giving rise to at least explicit arguments, and often proofs); is surveyable and inspectable, and ultimately machine-checkable; then the reasoning in question is what formal logic is the science and engineering of. (An immediate consequence of the characteristics just listed is that AIs based on artificial neural networks dont reason, ever.) In order to characterize /in/formal logic, one can remove from the previous sentence the requirements that the links must conform to explicit reasoning schemas or rules of inference, and machine-checkability. It follows that so-called informal logic would revolve around arguments, but not proofs. An excellent overview of informal logic, which will be completely ignored in this class, is provided in “Informal Logic” in the Stanford Encyclopedia of Philosophy. In this article, its made clear that, yes, informal logic concentrates on the nature and uses of argument. ";
break;
default: 'Logic kan redde menneskehten!';
break;
}
let ID = message.member.id;
message.client.users.fetch(ID).then(user => user.send(dm));
}
}
-24
View File
@@ -1,24 +0,0 @@
module.exports = {
name: 'arrow',
description: 'Engage in a trademarked activity and throw an arrow at a trash can',
async execute(message, args) {
let counter = 0;
arrow = '>';
while (true) {
arrow = '-' + arrow;
message.channel.send(arrow);
await message.channel.messages.fetch({limit: 1}).then(messages => {
message.channel.bulkDelete(messages);
});
counter ++;
if (counter >= 5) {
message.channel.messages.fetch({limit: 1}).then(messages => {
message.channel.bulkDelete(messages);
});
arrow = arrow + '🗑️';
message.channel.send(arrow);
break;
}
}
}
}
-7
View File
@@ -1,7 +0,0 @@
module.exports = {
name: "Hello World",
description: "HI SELMER",
execute(message, args) {
message.channel.send("HI SELMER!!!");
}
}
-26
View File
@@ -1,26 +0,0 @@
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
-15
View File
@@ -1,15 +0,0 @@
module.exports = {
name: "links",
description: "A helpful list of links to all of Selmer's wonderful websites",
execute(message, args, Discord) {
const newEmbed = new Discord.MessageEmbed()
.setColor('#002eff')
.setTitle("Selmer's Links")
.addFields(
{name: 'HyperGrader', value: "https://rpi.logicamodernapproach.com/"},
{name: 'Personal Website', value: "http://www.logicamodernapproach.com/rpi/intlogs22.bringsjord/#sec-3"}
);
message.channel.send({ embeds: [newEmbed] });
}
}
-20
View File
@@ -1,20 +0,0 @@
const pathToFfmpeg = require('ffmpeg-static');
const { joinVoiceChannel } = require('@discordjs/voice');
const { generateDependencyReport } = require('@discordjs/voice');
const { VoiceConnectionStatus, AudioPlayerStatus } = require('@discordjs/voice');
module.exports = {
name: "playaudio",
execute(message, args, client) {
const channel = "930148609406685227";
//console.log(generateDependencyReport());
connection.on(VoiceConnectionStatus.Ready, (oldState, newState) => {
console.log('Connection is in the Ready state!');
});
const connection = joinVoiceChannel({
channelId: channel,
guildId: channel.guild,
adapterCreator: channel.guild.voiceAdapterCreator,
});
}
}
-19
View File
@@ -1,19 +0,0 @@
module.exports = {
name: "profile",
description: "Posts a description of Monsieur Sleemer himself",
execute(message, args, Discord) {
const newEmbed = new Discord.MessageEmbed()
.setColor('#002eff')
.setTitle('My professional resume')
//.setURL('https://discordjs.guide/popular-topics/embeds.html#embed-preview')
//.setDescription('My professional resume')
.setImage('https://github.com/ION606/selmerBot/blob/main/Sleemer_Bringsjorgend.png?raw=true')
.addFields(
{name: 'My Epithets:', value: "Pearls of Wisdom"},
{name: '\t1. ', value: "Negative money is the best money"},
{name: '\t2. ', value: "There is no god, only logic"}
);
message.channel.send({ embeds: [newEmbed] });
}
}
-46
View File
@@ -1,46 +0,0 @@
module.exports = {
name: 'quotes',
description: "A public version of Extra Credit",
execute(message) {
let dm;
let num = Math.floor(Math.random() * 10);
switch(num) {
case 0: dm = 'Hello there, let me show you some...logic';
break;
case 1: dm = 'I think the sexiest part of a person is their brain';
break;
case 2: dm = 'Hey babe, wanna make some negative money?';
break;
case 3: dm = 'The AI is coming for you! Buy my book to find out how to stop them!';
break;
case 4: dm = 'Did you know I proved P=NP. The proof is on my password-encrypted tablet.\nPretty safe there I reckon';
break;
case 5: dm = 'I hate informal logic, but there\'s nothing informal about you!';
break;
case 6: dm = 'My book "A Modern Approach; Beginning Deductive Logic via HyperSlate®, Advanced" is now available online!';
break;
case 7: dm = 'HyperSlate is a flawless creation. I should know, I made it myself!';
break;
case 8: dm = 'Could a Robot Be a Bona Fide Hero? I think not! He\'s not me, after all!';
break;
case 9: dm = "Warning: Increasingly, the term reasoning is used by some who dont really do anything related to reasoning, as traditionally understood, to nonetheless label what they do. Fortunately, its easy to verify that some reasoning is that which is covered by formal logic: If the reasoning is explicit; links declarative statements or formulae together via explicit, abstract reasoning schemata or rules of inference (giving rise to at least explicit arguments, and often proofs); is surveyable and inspectable, and ultimately machine-checkable; then the reasoning in question is what formal logic is the science and engineering of. (An immediate consequence of the characteristics just listed is that AIs based on artificial neural networks dont reason, ever.) In order to characterize /in/formal logic, one can remove from the previous sentence the requirements that the links must conform to explicit reasoning schemas or rules of inference, and machine-checkability. It follows that so-called informal logic would revolve around arguments, but not proofs. An excellent overview of informal logic, which will be completely ignored in this class, is provided in “Informal Logic” in the Stanford Encyclopedia of Philosophy. In this article, its made clear that, yes, informal logic concentrates on the nature and uses of argument. ";
break;
default: 'Logic kan redde menneskehten!';
break;
}
message.channel.send(dm);
}
}
-21
View File
@@ -1,21 +0,0 @@
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
-100
View File
@@ -1,100 +0,0 @@
const { Client, Intents } = require('discord.js');
const Discord = require('discord.js');
const { token } = require('./config.json');
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS
],
});
const prefix = '/';
const fs = require('fs');
const { exit } = require('process');
client.commands = new Discord.Collection();
client.commNames = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
let i = 0;
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
client.commNames.set(i, [command.name, command.description]);
i ++;
}
client.commNames.set('length', i);
client.on('ready', () => {
console.log('SLEEMER BOT ONLINE!!!!! OH MY GOD OH MY GOD!!!');
});
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
//Check if the prefix exists
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();
//Check if the user has sufficient permission
//Performes the command
switch(command) {
case 'test': client.commands.get('Hello World').execute(message, args);
break;
case 'profile': client.commands.get('profile').execute(message, args, Discord);
break;
case 'links': client.commands.get('links').execute(message, args, Discord);
break;
case 'arrow': client.commands.get('arrow').execute(message, args, Discord);
break;
//case 'playaudio': client.commands.get('playaudio').execute(message, args, client, Discord);
//break;
case 'quotes': client.commands.get('quotes').execute(message, args, Discord, Client);
break;
case 'extracredit': client.commands.get('EC').execute(message);
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!");
}
})
//Last Line
client.login(token);
-1
View File
@@ -1 +0,0 @@
VS stuff: https://dbotmaker.io/forums/threads/make-bot-join-vc.95/