From 2e9866305e92011fcd8f728c42f313a1e3718a2d Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Thu, 16 Feb 2023 14:36:39 -0800 Subject: [PATCH] Update messageCreate.ts --- src/events/messageCreate.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 6637e5d..334631d 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -41,10 +41,8 @@ export default { await client.punishments.addPunishment('mute', { time: '30m' }, (client.user as Discord.User).id, 'Automod; Banned words', message.author, message.member as Discord.GuildMember); } } else { - client.repeatedMessages[message.author.id] = {data: new client.collection(), timeout: setTimeout(onTimeout, threshold)} + client.repeatedMessages[message.author.id] = { data: new client.collection(), timeout: setTimeout(onTimeout, threshold) }; client.repeatedMessages[message.author.id].data.set(message.createdTimestamp, {cont: 0, ch: message.channelId}); - // autodelete after 30 secs - client.repeatedMessages[message.author.id].timeout = setTimeout(onTimeout, threshold); } } if (message.content.toLowerCase().includes('discord.gg/') && !message.member.roles.cache.has(client.config.mainServer.roles.dcmod) && message.guildId == client.config.mainServer.id && !Whitelist.includes(message.channelId)) { @@ -67,9 +65,8 @@ export default { await client.punishments.addPunishment('mute', {time: '1h'}, (client.user as Discord.User).id, 'Automod; Discord advertisement', message.author, message.member as Discord.GuildMember); } }else{ - client.repeatedMessages[message.author.id].data = new client.collection(); + client.repeatedMessages[message.author.id] = { data: new client.collection(), timeout: setTimeout(onTimeout, threshold) }; client.repeatedMessages[message.author.id].data.set(message.createdTimestamp, {cont: 1, ch: message.channelId}); - client.repeatedMessages[message.author.id].timeout = setTimeout(onTimeout, threshold); } }