From ac967fc98ee6fe00fe298b2d16e310123e222ea2 Mon Sep 17 00:00:00 2001 From: rhearmas <34490428+qu-ota@users.noreply.github.com> Date: Fri, 20 Dec 2019 19:58:46 -0500 Subject: [PATCH] remove unneeded functions --- modules/functions.js | 62 -------------------------------------------- 1 file changed, 62 deletions(-) diff --git a/modules/functions.js b/modules/functions.js index 0b192e6..68f2299 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -76,68 +76,6 @@ module.exports = (client) => { return `Unable to load command ${commandName}: ${e}`; } }; - - client.unloadCommand = async (commandName) => { - let command; - if (client.commands.has(commandName)) { - command = client.commands.get(commandName); - } else if (client.aliases.has(commandName)) { - command = client.commands.get(client.aliases.get(commandName)); - } - if (!command) return `The command \`${commandName}\` doesn\'t seem to exist, nor is it an alias. Try again!`; - - if (command.shutdown) { - await command.shutdown(client); - } - const mod = require.cache[require.resolve(`../commands/${command.help.category}/${command.help.name}`)]; - delete require.cache[require.resolve(`../commands/${command.help.category}/${command.help.name}.js`)]; - for (let i = 0; i < mod.parent.children.length; i++) { - if (mod.parent.children[i] === mod) { - mod.parent.children.splice(i, 1); - break; - } - } - return false; - }; - - client.reloadCommand = async(commandName) => { - // step 1: unload the command - let command; - if (client.commands.has(commandName)) { - command = client.commands.get(commandName); - } else if (client.aliases.has(commandName)) { - command = client.commands.get(client.aliases.get(commandName)); - } - if (!command) return `The command \`${commandName}\` doesn\'t seem to exist, nor is it an alias. Try again!`; - - if (command.shutdown) { - await command.shutdown(client); - } - const mod = require.cache[require.resolve(`../commands/${command.help.category}/${commandName}.js`)]; - delete require.cache[require.resolve(`../commands/${command.help.category}/${commandName}.js`)]; - for (let i = 0; i < mod.parent.children.length; i++) { - if (mod.parent.children[i] === mod) { - mod.parent.children.splice(i, 1); - break; - } - } - return false; - - // step 2: load said command - try { - const props = require(`../commands/${command.help.category}/${command.Name}`); - if (props.init) { - props.init(client); - } - client.commands.set(props.help.name, props); - props.conf.aliases.forEach(alias => { - client.aliases.set(alias, props.help.name); - }); - return false; - } catch (e) { - return `Unable to load command ${commandName}: ${e}`; - } - } Object.defineProperty(String.prototype, "toProperCase", { value: function() {