| ... | @@ -41,6 +41,7 @@ const rateLimitCache2 = new Cache({ | ... | @@ -41,6 +41,7 @@ const rateLimitCache2 = new Cache({ |
| 41 | | 41 | |
| 42 | async function cleanup(guild) { | 42 | async function cleanup(guild) { |
| 43 | clearTimeout(schedules[guild.id]); | 43 | clearTimeout(schedules[guild.id]); |
| | 44 | delete schedules[guild.id]; |
| 44 | let n = 0; | 45 | let n = 0; |
| 45 | const rolesToCheck = guild.roles.cache.filter(role => role.name.startsWith('#')); | 46 | const rolesToCheck = guild.roles.cache.filter(role => role.name.startsWith('#')); |
| 46 | const allMembers = await guild.members.fetch(); | 47 | const allMembers = await guild.members.fetch(); |
| ... | @@ -62,7 +63,7 @@ async function cleanup(guild) { | ... | @@ -62,7 +63,7 @@ async function cleanup(guild) { |
| 62 | } | 63 | } |
| 63 | | 64 | |
| 64 | async function scheduleClean(guild) { | 65 | async function scheduleClean(guild) { |
| 65 | if (!schedules[guild.id]) { | 66 | if (schedules[guild.id]) { |
| 66 | return; | 67 | return; |
| 67 | } | 68 | } |
| 68 | schedules[guild.id] = setTimeout(() => { | 69 | schedules[guild.id] = setTimeout(() => { |
| ... | @@ -79,6 +80,7 @@ client.on('message', async (msg) => { | ... | @@ -79,6 +80,7 @@ client.on('message', async (msg) => { |
| 79 | if (msg.content.startsWith('!paint') || msg.content.startsWith('!color')) { | 80 | if (msg.content.startsWith('!paint') || msg.content.startsWith('!color')) { |
| 80 | if(rateLimitCache.get(msg.author.id)) { | 81 | if(rateLimitCache.get(msg.author.id)) { |
| 81 | msg.channel.send('> **Rate Limited**: This command can only be used every 12 seconds (per user).') | 82 | msg.channel.send('> **Rate Limited**: This command can only be used every 12 seconds (per user).') |
| | 83 | return; |
| 82 | } | 84 | } |
| 83 | | 85 | |
| 84 | const args = msg.content.split(' '); | 86 | const args = msg.content.split(' '); |