From e0e8a57bef2dea6d58bf94e8645d04492e29b320 Mon Sep 17 00:00:00 2001 From: carol <34490428+rhearmas@users.noreply.github.com> Date: Mon, 6 Jan 2020 10:14:33 -0800 Subject: [PATCH 1/3] extend command bypassing if a command begins with an underscore ("_"), it won't be loaded. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index be62cf5..9992a88 100644 --- a/index.js +++ b/index.js @@ -38,7 +38,7 @@ const init = async () => { await crawl("commands",cmdFiles); client.logger.log(`Loading a total of ${cmdFiles.length} commands.`); cmdFiles.forEach(f => { - if (!f.endsWith(".js")) return; + if (!f.endsWith(".js") || !f.startsWith("_")) return; const response = client.loadCommand(f); if (response) console.log(response); }); @@ -61,4 +61,4 @@ const init = async () => { client.login(client.config.token); }; -init(); \ No newline at end of file +init(); From 612b7afb4e4c231a915f3615b2a707a250ba0f54 Mon Sep 17 00:00:00 2001 From: Carol Knieriem Date: Mon, 6 Jan 2020 16:00:14 -0500 Subject: [PATCH 2/3] slowmode so i don't have to use another bot --- commands/Utility/slowmode.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 commands/Utility/slowmode.js diff --git a/commands/Utility/slowmode.js b/commands/Utility/slowmode.js new file mode 100644 index 0000000..2df45d4 --- /dev/null +++ b/commands/Utility/slowmode.js @@ -0,0 +1,21 @@ +exports.run = async (client, message, args, level) => { + let rateLimit = +args[0] || 0; + + message.channel.rateLimitPerUser = rateLimit; + (await message.channel.send(`${message.author} has set ${message.channel}'s slowmode to ${rateLimit} seconds.`)).delete(5000); +}; + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: ["sm","setslowmode"], + permLevel: "Administrator" +}; + +exports.help = { + name: "slowmode", + category: "Utility", + description: "Set the slowmode for a channel. If no arguments are provided, this command will disable it.", + emoji: "sparkle", + usage: "slowmode [time:0]" +}; \ No newline at end of file From b1f204fd509bce7121fd39e03be251f17a834f8e Mon Sep 17 00:00:00 2001 From: Carol Knieriem Date: Mon, 6 Jan 2020 16:00:36 -0500 Subject: [PATCH 3/3] remove commented text --- commands/_base.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/commands/_base.js b/commands/_base.js index a828074..4fe0961 100644 --- a/commands/_base.js +++ b/commands/_base.js @@ -1,5 +1,3 @@ -/* make sure these aren't commented - exports.run = async (client, message, args, level) => { }; @@ -18,13 +16,8 @@ exports.help = { usage: "" }; -*/ - -/* Basic message auto-deletion - +// Basic message auto-deletion if (!args[0]) { - message.delete(); - return (await message.reply("text")).delete(5000); -} - -*/ \ No newline at end of file + message.delete(); + return (await message.reply("text")).delete(5000); +} \ No newline at end of file