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