This commit is contained in:
parent
76d24311f0
commit
174737a4a4
|
@ -1 +1,2 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
|
.DS_Store
|
||||||
|
|
21
src/index.js
21
src/index.js
|
@ -2,7 +2,7 @@
|
||||||
// Load up the libraries
|
// Load up the libraries
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const prettyMilliseconds = require('pretty-ms');
|
const prettyMilliseconds = require('pretty-ms');
|
||||||
|
const fs = require('fs');
|
||||||
//importing files
|
//importing files
|
||||||
const config = require("./config.json");
|
const config = require("./config.json");
|
||||||
// This is making clients
|
// This is making clients
|
||||||
|
@ -106,7 +106,7 @@ client.on("message", async message => {
|
||||||
};
|
};
|
||||||
|
|
||||||
if(command === "squad") {
|
if(command === "squad") {
|
||||||
min = Math.ceil(0);
|
min = Math.ceil(0);
|
||||||
max = Math.floor(11);
|
max = Math.floor(11);
|
||||||
let rate = Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
let rate = Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
|
||||||
return message.reply(`The squad rates this ${rate} out of 10`);
|
return message.reply(`The squad rates this ${rate} out of 10`);
|
||||||
|
@ -146,11 +146,19 @@ client.on("message", async message => {
|
||||||
};
|
};
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
if(command === "quote") {
|
if(command === "quote") {
|
||||||
|
const quotes = require('~/quotes.json');
|
||||||
|
const quoteadd = "";
|
||||||
if(toLowerCase(args[0]) === "add") {
|
if(toLowerCase(args[0]) === "add") {
|
||||||
let quote = args.shift();
|
quoteadd = args.shift();
|
||||||
const quotes = require('~/.quotes.json');
|
quotes.quotes.push(quoteadd);
|
||||||
|
JSON.stringify(quotes);
|
||||||
|
fs.createWriteStream("~/quotes.json", quotes, {emitClose: "true"});
|
||||||
|
client.channels.get('712084662033580064').send(`${message.member} has submitted ${quote} to the quote repository`);
|
||||||
|
return message.reply("Quote added to repository");
|
||||||
};
|
};
|
||||||
|
const number = quotes.quotes.length() + 1;
|
||||||
|
let quotesend = Math.floor(Math.random() * (number - 0) + 0);
|
||||||
|
return message.send(`\`\`\`${quotes.quotes[quotesend]}\`\`\``);
|
||||||
};
|
};
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
if (command === "version") {
|
if (command === "version") {
|
||||||
|
@ -214,6 +222,3 @@ if(process.argv.slice(2).includes("--TEST")) {
|
||||||
|
|
||||||
//Logging in the bot
|
//Logging in the bot
|
||||||
client.login(config.token)
|
client.login(config.token)
|
||||||
const googleDriveInstance = new NodeGoogleDrive({
|
|
||||||
ROOT_FOLDER: YOUR_ROOT_FOLDER
|
|
||||||
});
|
|
||||||
|
|
Loading…
Reference in New Issue