From 619df698350e878a02ea0cad8cd2b2374b5ec3a2 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Wed, 13 Jan 2021 09:03:33 -0500 Subject: [PATCH] obvious fixes i'm too blind to see --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 15491996725f399195025f36e37fd073debeb59c..f54135ace95f0f7e75a4979f79e683086292d4b6 100644 --- a/index.js +++ b/index.js @@ -41,6 +41,7 @@ const rateLimitCache2 = new Cache({ async function cleanup(guild) { clearTimeout(schedules[guild.id]); + delete schedules[guild.id]; let n = 0; const rolesToCheck = guild.roles.cache.filter(role => role.name.startsWith('#')); const allMembers = await guild.members.fetch(); @@ -62,7 +63,7 @@ async function cleanup(guild) { } async function scheduleClean(guild) { - if (!schedules[guild.id]) { + if (schedules[guild.id]) { return; } schedules[guild.id] = setTimeout(() => { @@ -79,6 +80,7 @@ client.on('message', async (msg) => { if (msg.content.startsWith('!paint') || msg.content.startsWith('!color')) { if(rateLimitCache.get(msg.author.id)) { msg.channel.send('> **Rate Limited**: This command can only be used every 12 seconds (per user).') + return; } const args = msg.content.split(' '); -- 2.54.0