From 4e334c145906605efa2909bd6d54e6a8f9d200bf Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 26 May 2020 19:04:50 -0500 Subject: [PATCH] Update index.js --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index fff1686..f865d97 100755 --- a/src/index.js +++ b/src/index.js @@ -154,11 +154,12 @@ client.on("message", async message => { return message.channel.send(`${quotes.quotes[quotesend]}`); }; if(selector === "add") { + if (message.member.roles.cache.some(r => ["Admin","Mods","Member of the Order","Botmeister","Ally of the Order","say"].includes(r.name))) return message.reply("Ask someone with the quote role to add that.") args.shift(); //This does logic to make it from an array to a nice string. quoteadd = args.join(' '); quotes.quotes.push(quoteadd) - fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes), (err) => { + fs.writeFile(`${homedir}/quotes.json`, JSON.stringify(quotes, null, 2), (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");