mirror of
https://github.com/ION606/selmerBot.git
synced 2026-06-06 07:12:58 +00:00
Changed the file structure to make the command reading process clearer and improve organization
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
module.exports = {
|
||||
name: 'extracredit',
|
||||
description: "Selmer Bot Dm's you for some *AHEM* extra credit",
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
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 don’t really do anything related to reasoning, as traditionally understood, to nonetheless label what they do. Fortunately, it’s 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 don’t 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, it’s 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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
module.exports = {
|
||||
name: 'arrow',
|
||||
description: 'Engage in a trademarked activity and throw an arrow at a trash can',
|
||||
async execute(message, args, Discord, Client, bot) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
module.exports ={
|
||||
name: "help",
|
||||
description: "Gets help for all of Selmer Bot's commands",
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
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')
|
||||
|
||||
message.channel.send({ embeds: [newEmbed] });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
const { MongoClient, ServerApiVersion } = require('mongodb');
|
||||
// const { update } = require('apt');
|
||||
const { Collection, Client, Formatters, Intents } = require('discord.js');
|
||||
const BASE_PAY = 5;
|
||||
const BASE_LVL_XP = 35;
|
||||
//Note that leveling up to the next level takes 10% more xp than the previous one
|
||||
|
||||
|
||||
//#region functions
|
||||
|
||||
function isNum(arg) {
|
||||
return (!isNaN(arg) && Number.isSafeInteger(Number(arg)));
|
||||
};
|
||||
|
||||
|
||||
function addxp(message, dbo, amt, xp_list) {
|
||||
if (!isNum(amt)) { return console.log("This isn't a number...."); }
|
||||
|
||||
dbo.find({"balance": {$exists: true}}).toArray(function(err, doc) {
|
||||
if (!String(doc)) { return console.log("ERROR!\nThis account does not exist!"); }
|
||||
|
||||
temp = doc[0];
|
||||
let rank = temp.rank + 1;
|
||||
const txp = temp.xp + amt;
|
||||
//If the rank is less than 100, you can still advance
|
||||
if (rank < 101) {
|
||||
let needed = xp_list.get(rank);
|
||||
if (txp >= needed) {
|
||||
//Get to the max level possible with the current xp (may skip)
|
||||
while (txp >= needed) {
|
||||
rank ++;
|
||||
needed = xp_list.get(rank);
|
||||
}
|
||||
rank --; //Maybe?
|
||||
dbo.updateOne({balance: temp.balance, rank: temp.rank, lastdayworked: temp.lastdayworked}, { $set: { rank: rank }});
|
||||
message.channel.send('Congradulations <@' + message.author.id + '> for reaching rank ' + String(rank) + '!');
|
||||
}
|
||||
}
|
||||
|
||||
dbo.updateOne({balance: temp.balance}, { $set: { xp: txp}});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function rank(dbo, message, xp_list) {
|
||||
dbo.find({"balance": {$exists: true}}).toArray(function(err, doc) {
|
||||
if (!String(doc)) { return console.log("ERROR!\nThis account does not exist!"); }
|
||||
|
||||
let next = doc[0].rank + 1;
|
||||
let needed = xp_list.get(next);
|
||||
|
||||
message.channel.send('<@' + message.author.id + '> you are currently at rank ' + String(next-1) + ' and have ' + String(doc[0].xp) + 'xp. You need ' + String(needed - doc[0].xp) + ' more xp to get to rank ' + String(next));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//Changes one type of currency for another
|
||||
function convertCurrency(id, amt, dbo) {
|
||||
|
||||
}
|
||||
|
||||
function checkAndUpdateBal(dbo, item, message, args) {
|
||||
let b = false;
|
||||
dbo.find({"balance": {$exists: true}}).toArray(b = function(err, doc) {
|
||||
if (!String(doc)) { return message.reply("Your account doesn't exist, please contact the mods for support"); }
|
||||
|
||||
const icost = args[0] * item.cost;
|
||||
if (doc[0].balance < icost) {
|
||||
message.reply("Insufficient funds!");
|
||||
return false;
|
||||
} else {
|
||||
let temp = doc[0];
|
||||
dbo.updateOne({balance: temp.balance, rank: temp.rank, lastdayworked: temp.lastdayworked}, { $set: { balance: doc[0].balance -= icost }});
|
||||
message.reply("You have bought " + item.name + " for $" + icost + "!");
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
function buy(id, message, args, dbo, shop, xp_list) {
|
||||
if (args.length < 2) { return; }
|
||||
if (!isNum(args[0])) { return message.reply("Please enter a number for query 2"); }
|
||||
|
||||
let query = args[1];
|
||||
let item = shop.filter(function (item) { return item.name.toLowerCase() == query.toLowerCase(); });
|
||||
|
||||
if (!String(item)) { return message.reply("This item does not exist!"); }
|
||||
|
||||
let success = Boolean(checkAndUpdateBal(dbo, item[0], message, args));
|
||||
if (!success) { return; }
|
||||
|
||||
var newObj = { name: item[0].name, cost: item[0].cost, icon: item[0].icon, sect: item[0].sect};
|
||||
|
||||
addxp(message, dbo, Math.ceil(item[0].cost * 1.2), xp_list);
|
||||
dbo.find(newObj, {$exists: true}).toArray(function(err, doc) {
|
||||
if(String(doc)) {
|
||||
let newnum = doc[0].num + Number(args[0]);
|
||||
console.log(newnum);
|
||||
dbo.updateOne({ name: item[0].name }, {$set: {num: newnum}});
|
||||
} else {
|
||||
dbo.insertOne({ name: item[0].name, cost: item[0].cost, icon: item[0].icon, sect: item[0].sect, num: Number(args[0])});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
function sell(id, message, args, dbo, shop) {
|
||||
if (args.length < 2) { return; }
|
||||
if (!isNum(args[0])) { return message.reply("Please enter a number for query 2"); }
|
||||
var newObj = { name: args[1] };
|
||||
|
||||
let query = args[1];
|
||||
let item = shop.filter(function (item) { return item.name.toLowerCase() == query.toLowerCase(); });
|
||||
if (!String(item)) { return message.reply("This item does not exist!"); }
|
||||
if (!success) { return; }
|
||||
|
||||
dbo.find(newObj, {$exists: true}).toArray(function(err, doc) {
|
||||
return console.log(String(doc));
|
||||
if(String(doc)) {
|
||||
dbo.updateOne({ name: args[1] }, {$set: {num: doc[0].num + Number(args[0])}});
|
||||
} else {
|
||||
message.reply("You don't own this item!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function work(dbo, message, xp_list) {
|
||||
let fulldate = new Date();
|
||||
let date = fulldate.getDate();
|
||||
dbo.find({"lastdayworked": {$exists: true}}).toArray(function(err, doc) {
|
||||
if (!String(doc)) { return message.reply("Your account doesn't exist, please contact the mods for support"); }
|
||||
if (doc[0].lastdayworked == date) {
|
||||
message.reply("You've already worked today, try again tomorrow!");
|
||||
} else {
|
||||
//Amount to be paid
|
||||
let amt = 0;
|
||||
amt = BASE_PAY * doc[0].rank;
|
||||
dbo.updateOne({balance: doc[0].balance, rank: doc[0].rank}, { $set: { balance: amt, lastdayworked: date }});
|
||||
addxp(message, dbo, Math.ceil(amt*1.5), xp_list);
|
||||
message.channel.send('<@' + message.author.id + '> worked and earned $' + amt +' and ' + Math.ceil(amt*1.5) + ' xp!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function printInventory(dbo, message) {
|
||||
let tempstring = "";
|
||||
dbo.find().toArray(function(err, docs){
|
||||
docs.forEach(val => {
|
||||
if (!val.balance) {
|
||||
tempstring += String(val.num) + " " + val.name + " (" + val.icon + ")\n";
|
||||
}
|
||||
});
|
||||
message.reply(tempstring);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getBalance(dbo, message) {
|
||||
dbo.find({"balance": {$exists: true}}).toArray(function(err, doc) {
|
||||
message.reply('Your current balance is $' + String(doc[0].balance));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getShop(message, args, items) {
|
||||
if (args.length == 0) {
|
||||
let temp = Formatters.codeBlock(items.map(i => `${i.sect}`).join(' '));
|
||||
temp = [...new Set(temp.split(' '))];
|
||||
|
||||
return message.reply("Please use the format /shop [type] [page number]\nTypes are: " + temp);
|
||||
}
|
||||
|
||||
let ind = 1;
|
||||
let noinp = false;
|
||||
if (args.length > 1) {
|
||||
if (args[1] < (items.length / 9)) {
|
||||
ind = Number(args[1]);
|
||||
} else {
|
||||
return message.reply("That number is too large");
|
||||
}
|
||||
} else {
|
||||
noinp = true;
|
||||
}
|
||||
|
||||
const items2 = items.slice((ind - 1)*10, (ind - 1)*10+10);
|
||||
newText = Formatters.codeBlock(items2.map(i => `${i.icon} (${i.name}): \$${i.cost}`)
|
||||
.filter(f => f.sect = args[0]).join('\n'));
|
||||
|
||||
if (noinp) {
|
||||
newText += "(Use /shop [type] [page number] to access other pages)";
|
||||
}
|
||||
|
||||
return message.reply(newText);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//Main Code
|
||||
module.exports = {
|
||||
name: 'ECON',
|
||||
description: 'ECON',
|
||||
async execute(bot, message, args, command, Discord, mongouri, items, xp_list) {
|
||||
//Set Discord vars
|
||||
const id = message.author.id;
|
||||
const server = message.guild.id;
|
||||
|
||||
const client = new MongoClient(mongouri, { useNewUrlParser: true, useUnifiedTopology: true, serverApi: ServerApiVersion.v1 });
|
||||
client.connect(err => {
|
||||
const db = client.db(server);
|
||||
const dbo = db.collection(id);
|
||||
if (err) { return console.log(err); }
|
||||
//Initialize if necessary
|
||||
db.listCollections({name: id})
|
||||
.next(function(err, collinfo) {
|
||||
if (!collinfo) {
|
||||
message.reply("You didn't have a place in my databases, so I created one for you!\nPlease try your command again!")
|
||||
dbo.insertOne({balance: 100, rank: 1, lastdayworked: 0, xp: 0});
|
||||
return;
|
||||
}
|
||||
|
||||
//test area
|
||||
if (command == 'xp' || command == 'adbal') {
|
||||
if (message.member.roles.cache.has('944048889038774302')) {
|
||||
if (command == 'xp') {
|
||||
return addxp(message, dbo, Number(args[0]), xp_list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Command Area
|
||||
if(command == 'init') {
|
||||
//Add security check here
|
||||
// init.execute(bot, message, args, command, dbo, Discord, connect);
|
||||
return;
|
||||
} else if (command == 'checkinv') {
|
||||
const req = dbo.findOne({ id: message.guild.id });
|
||||
if (!req) { return message.reply("Doc doesn't exist!"); }
|
||||
} else if (command == 'buy') {
|
||||
buy(id, message, args, dbo, items, xp_list);
|
||||
} else if (command == 'shop') {
|
||||
getShop(message, args, items);
|
||||
} else if (command == 'work') {
|
||||
work(dbo, message, xp_list);
|
||||
} else if (command == 'rank') {
|
||||
rank(dbo, message, xp_list);
|
||||
} else if (command == 'inventory') {
|
||||
printInventory(dbo, message);
|
||||
} else if (command == 'balance') {
|
||||
getBalance(dbo, message);
|
||||
} else {
|
||||
message.channel.send("'" + message.content + "' is not a command!");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
//Close the database
|
||||
client.close();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
name: "test",
|
||||
description: "HI SELMER",
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
message.channel.send("HI SELMER!!!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
module.exports ={
|
||||
name: 'kareoke',
|
||||
description: 'Sing your least-favorite song with your favorite person, me!',
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
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
|
||||
@@ -0,0 +1,15 @@
|
||||
module.exports = {
|
||||
name: "links",
|
||||
description: "A helpful list of links to all of Selmer's wonderful websites",
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
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] });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
const pathToFfmpeg = require('ffmpeg-static');
|
||||
const { joinVoiceChannel, createAudioResource } = require('@discordjs/voice');
|
||||
const { generateDependencyReport } = require('@discordjs/voice');
|
||||
const { VoiceConnectionStatus, AudioPlayerStatus, createAudioPlayer, StreamType } = require('@discordjs/voice');
|
||||
const play = require('play-dl');
|
||||
|
||||
// Leave here to be initialized at the program's start
|
||||
const player = createAudioPlayer();
|
||||
|
||||
// Note: Unsure of what this does , but may be related to the play-dl lib (my notes are inconsistent)
|
||||
// play.authorization();
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: "audio",
|
||||
async execute(message, args, Discord, Client, bot) {
|
||||
// message.channel.send("This command has not been set up yet\nSorry!");
|
||||
// return;
|
||||
if (args[0] == "play") {
|
||||
if (args.length < 1) {
|
||||
message.reply("Please specify a function (play, pause, unpause or stop)");
|
||||
return;
|
||||
} else if (args.length < 2) {
|
||||
message.reply("Please provide a song url");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Re-introduce once the issue with ydtl-core is resolved (see
|
||||
https://github.com/porridgewithraisins/jam-bot#known-bugs)
|
||||
const stream = await ytdl(url, { filter: 'audioonly' });
|
||||
*/
|
||||
|
||||
if (!message.member.voice.channel) {
|
||||
message.reply("Please join a voice channel before you try this!");
|
||||
return;
|
||||
}
|
||||
//Test 930148609406685227
|
||||
const channel = bot.channels.cache.get(message.member.voice.channel.id);
|
||||
console.log(message.member.voice.channel.id);
|
||||
const connection = joinVoiceChannel({
|
||||
channelId: channel.id,
|
||||
guildId: channel.guild.id,
|
||||
adapterCreator: channel.guild.voiceAdapterCreator,
|
||||
});
|
||||
|
||||
connection.on(VoiceConnectionStatus.Ready, () => {
|
||||
console.log('Connected to the voice channel!');
|
||||
});
|
||||
|
||||
if (args[0] == "play") {
|
||||
let stream;
|
||||
let info = "Playing __***";
|
||||
let yt_info;
|
||||
if (args[1].startsWith("https://")) {
|
||||
if (!args[1].startsWith("https://www.youtube.com/") &&
|
||||
!args[1].startsWith("https://music.youtube.com/")) {
|
||||
message.reply("This is not a valid YouTube URL");
|
||||
return;
|
||||
}
|
||||
yt_info = await play.video_info(args[1]);
|
||||
// let stream = await play.stream_from_info(yt_info)
|
||||
stream = await play.stream(args[1]);
|
||||
|
||||
console.log("Playing from a URL!");
|
||||
} else {
|
||||
yt_info = await play.search(args.slice(1).join(' '), {
|
||||
limit: 1
|
||||
});
|
||||
|
||||
stream = await play.stream(yt_info[0].url);
|
||||
yt_info = await play.video_info(yt_info[0].url);
|
||||
}
|
||||
|
||||
//Add the video info to the return message
|
||||
info += yt_info.video_details.title + "***__\n";
|
||||
info += "Check it out at " + yt_info.video_details.url + "\n";
|
||||
|
||||
|
||||
let resource = createAudioResource(stream.stream, {
|
||||
inputType: stream.type
|
||||
})
|
||||
|
||||
connection.subscribe(player);
|
||||
|
||||
let audio = "em.mp3";
|
||||
// let resource = createAudioResource(join(__dirname, audio));
|
||||
player.play(resource);
|
||||
|
||||
player.on(AudioPlayerStatus.Playing, () => {
|
||||
console.log('The audio player has started playing!');
|
||||
});
|
||||
message.reply(info);
|
||||
} else if (args[0] == "pause") {
|
||||
player.pause();
|
||||
} else if (args[0] == "unpause") {
|
||||
player.unpause();
|
||||
} else if (args[0] == "stop") {
|
||||
player.stop();
|
||||
connection.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
module.exports = {
|
||||
name: "profile",
|
||||
description: "Posts a description of Monsieur Sleemer himself",
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
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] });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
module.exports = {
|
||||
name: 'quotes',
|
||||
description: "A public version of Extra Credit",
|
||||
execute(message, args, Discord, Client, bot) {
|
||||
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 don’t really do anything related to reasoning, as traditionally understood, to nonetheless label what they do. Fortunately, it’s 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 don’t 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, it’s 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
name: 'r',
|
||||
description: "Reacts with a phrase or single emoji",
|
||||
async execute(message, args, Discord, Client, bot) {
|
||||
|
||||
// if (!message.reference) { return; }
|
||||
let msg;
|
||||
if (message.reference) {
|
||||
msg = await message.channel.messages.fetch(message.reference.messageId);
|
||||
} else { msg = message; }
|
||||
|
||||
for (let i = 0; i < args.length; i ++) {
|
||||
try {
|
||||
await msg.react(args[i]);
|
||||
} catch(err) {
|
||||
//The emoji wasn't a valid one
|
||||
message.reply("Please enter a valid emoji");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
const hastebin = require("hastebin-gen");
|
||||
|
||||
module.exports ={
|
||||
name: "scrape",
|
||||
description: ".....",
|
||||
async execute(message, args, Discord, Client, bot) {
|
||||
const axios = require('axios');
|
||||
const cheerio = require('cheerio')
|
||||
const url = args[0];
|
||||
axios(url)
|
||||
.then(async response => {
|
||||
const html = response.data;
|
||||
const $ = cheerio.load(html);
|
||||
//lyrics = $('.para_row').text();
|
||||
const haste = await hastebin(html, { extension: "txt" });
|
||||
message.channel.send(haste);
|
||||
// console.log(lyrics);
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
}
|
||||
|
||||
//TEST: https://www.karaoketexty.cz/texty-pisni/zoegirl/plain-170199
|
||||
Reference in New Issue
Block a user