thearkxd/discord-moderation-bot

Ready hataswı

wioniqle-q opened this issue · 1 comments

const activePenals = await penals.find({ guildID: guild.id, active: true });
activePenals.forEach(async (x) => {
const member = guild.members.cache.get(x.userID);
if (!member) return;
if (x.type === "CHAT-MUTE" && !conf.penals.chatMute.roles.some((x) => member.roles.cache.has(x))) return member.roles.add(conf.penals.chatMute.roles);
if ((x.type === "JAIL" || x.type === "TEMP-JAIL") && !conf.penals.jail.roles.some((x) => member.roles.cache.has(x))) return member.setRoles(conf.penals.jail.roles);
if (x.type === "VOICE-MUTE") {
if (!conf.penals.voiceMute.roles.some((x) => member.roles.cache.has(x))) member.roles.add(conf.penals.voiceMute.roles);
if (member.voice.channelID && !member.voice.serverMute) member.voice.setMute(true);
}
});
}, 1000 * 5);

bu üstteki yanlış olan

alttaki düzgün olan

 const activePenals = await penals.find({ guildID: guild.id, active: true });
activePenals.forEach(async (x) => {
  const member = guild.members.cache.get(x.userID);
  if (!member) return;
  if (x.type === "CHAT-MUTE" && !conf.penals.chatMute.roles.some((x) => member.roles.cache.has(x))) return member.roles.add(conf.penals.chatMute.roles);
  if ((x.type === "JAIL" || x.type === "TEMP-JAIL") && !conf.penals.jail.roles.some((x) => member.roles.cache.has(x))) return member.roles.set(conf.penals.jail.roles);
  if (x.type === "VOICE-MUTE") {
    if (!conf.penals.voiceMute.roles.some((x) => member.roles.cache.has(x))) member.roles.add(conf.penals.voiceMute.roles);
    if (member.voice.channelID && !member.voice.serverMute) member.voice.setMute(true);
  }
});

}, 1000 * 5);

sdf