bot.on('guildMemberRemove', async member => { const kanal = bot.channels.cache.get("698649855727501402"); const fetchedLogs = await member.guild.fetchAuditLogs({ limit: 1, type: 'MEMBER_KICK', }); const kickLog = fetchedLogs.entries.first(); if (!kickLog) return kanal.send(`${member.user.tag} left the guild, most likely of their own will.`); const { executor, target } = kickLog; if (target.id === member.id) { kanal.send(`${member.user.tag} left the guild; kicked by ${executor.tag}?`); } else { kanal.send(`${member.user.tag} left the guild, audit log fetch was inconclusive.`); } });