mirror of
https://github.com/System-End/Discord-Bot.git
synced 2026-04-19 22:05:15 +00:00
Word blacklist bug fix
This commit is contained in:
parent
38f7782f50
commit
6b9db967af
4 changed files with 4 additions and 8 deletions
|
|
@ -1,5 +0,0 @@
|
|||
const { Collection } = require("discord.js");
|
||||
|
||||
const blacklistedWords = new Collection();
|
||||
|
||||
module.exports = { blacklistedWords };
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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 { }
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue