From 38a0cc6bfd03babe30d2509bc1b9fa56818b881e Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 21 May 2021 08:43:18 -0600 Subject: [PATCH] reload security bug --- commands/dev/reload.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/commands/dev/reload.js b/commands/dev/reload.js index c5ad233..ed73ebc 100644 --- a/commands/dev/reload.js +++ b/commands/dev/reload.js @@ -20,12 +20,11 @@ module.exports = { extra: null }, async execute(message, msg, args, cmd, prefix, mention, client) { - let timer = new Date().getTime(); + const tu = await UserData.findOne({uid: message.author.id}); + if (!tu || !tu.developer) {return message.channel.send("You must be a Natsuki developer in order to do this!");} if (!args.length) { - const tu = await UserData.findOne({uid: message.author.id}); - if (!tu || !tu.developer) {return message.channel.send("You must be a Natsuki developer in order to do this!");} - + let timer = new Date().getTime(); let commands = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); let dirSet = new Map(); fs.readdirSync('./commands').filter(file => !file.includes('.')).forEach(dir => fs.readdirSync(`./commands/${dir}`).filter(file => file.endsWith('.js')).forEach(x => {commands.push(x); dirSet.set(x, dir)}));