diff --git a/src/Collection/index.js b/src/Collection/index.js deleted file mode 100644 index 9a239c6..0000000 --- a/src/Collection/index.js +++ /dev/null @@ -1,5 +0,0 @@ -const { Collection } = require("discord.js"); - -const blacklistedWords = new Collection(); - -module.exports = { blacklistedWords }; \ No newline at end of file diff --git a/src/commands/automod/add.js b/src/commands/automod/add.js index 1395a38..05f1cdc 100644 --- a/src/commands/automod/add.js +++ b/src/commands/automod/add.js @@ -17,6 +17,7 @@ module.exports = async (client, interaction, args) => { if(!data.Words) data.Words = []; data.Words.push(word); data.save(); + if(!blacklistedWords.get(interaction.guild.id)) blacklistedWords.set(interaction.guild.id, []) blacklistedWords.get(interaction.guild.id).push(word); } else { diff --git a/src/events/guild/guildMemberRemove.js b/src/events/guild/guildMemberRemove.js index 56f1832..78f1478 100644 --- a/src/events/guild/guildMemberRemove.js +++ b/src/events/guild/guildMemberRemove.js @@ -58,7 +58,7 @@ module.exports = async (client, member) => { }) } else { - client.users.fetch(inviteData.inviteUser).then(async (user) => { + client.users.fetch(inviteData.User).then(async (user) => { const channel = member.guild.channels.cache.get(channelData.Channel) diff --git a/src/handlers/security/blacklist.js b/src/handlers/security/blacklist.js index 9db744d..3d528ea 100644 --- a/src/handlers/security/blacklist.js +++ b/src/handlers/security/blacklist.js @@ -18,7 +18,7 @@ module.exports = async (client) => { await Promise.all( splittedMsg.map((content) => { try { - if (blacklistedWords.get(message.guild.id).includes(content.toLowerCase())) deleting = true; + if (data.Words.includes(content.toLowerCase())) deleting = true; } catch { } }) @@ -47,7 +47,7 @@ module.exports = async (client) => { await Promise.all( splittedMsg.map((content) => { try { - if (blacklistedWords.get(newMessage.guild.id).includes(content.toLowerCase())) deleting = true; + if (data.Words.includes(content.toLowerCase())) deleting = true; } catch { } })