From abb41e182e8f6be0f1ce7807c88f7ea2b96930f9 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 25 May 2020 18:17:55 -0500 Subject: [PATCH] fuck you gamma --- src/index.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index f806e14..4773b50 100755 --- a/src/index.js +++ b/src/index.js @@ -147,15 +147,16 @@ client.on("message", async message => { let selector = args[0].toLowerCase() try{ if(selector === "add") { - quoteadd = args.shift(); - quotes.quotes.push(quoteadd); - fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes), (err) => { + args.shift(); + quoteadd = args + quotes.quotes.push(quoteadd); + fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes), (err) => { if (err) return message.reply("Something went wrong"); + client.channels.cache.get('712084662033580064').send(`${message.member} has submitted ${quoteadd} to the quote repository`); + return message.reply("Quote added to repository"); }); - } catch (error) {}; - client.channels.cache.get('712084662033580064').send(`${message.member} has submitted ${quoteadd} to the quote repository`); - return message.reply("Quote added to repository"); - }; + }; + } catch (err) {}; var number = quotes.quotes.length() + 1; let quotesend = Math.floor(Math.random() * (number - 0) + 0); return message.send(`\`\`\`${quotes.quotes[quotesend]}\`\`\``);