From e2c9d0c377983994f4a0b7553c864ef8fb4ca8bc Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Wed, 31 May 2023 09:44:19 +1000 Subject: [PATCH] Fix the broken advertisement automod. --- src/events/messageCreate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 3cbd32d..5ccc65e 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -41,7 +41,7 @@ export default { message.channel.send('That word isn\'t allowed here.').then(x=>setTimeout(()=>x.delete(), 10000)); await repeatedMessages(30000, 3, 'bw', '30m', 'Constant swearing'); } else if (message.content.toLowerCase().includes('discord.gg/') && !client.isStaff(message.member as Discord.GuildMember)){ - const url = msgarr.find(x=>x.includes('discord.gg/')); + const url = message.content.split(' ').find(x=>x.includes('discord.gg/')); const validInvite = await client.fetchInvite(url).catch(()=>undefined); if (validInvite && validInvite.guild?.id !== client.config.mainServer.id){ automodded = true;