From 3ad46b7950e03fbb934b55d8991b1b0665207b62 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 7 Mar 2020 17:59:09 +0100 Subject: [PATCH] Changed guild to member --- event/listeners/guildMemberRemove.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/event/listeners/guildMemberRemove.js b/event/listeners/guildMemberRemove.js index 967f18ea..e798a5ac 100644 --- a/event/listeners/guildMemberRemove.js +++ b/event/listeners/guildMemberRemove.js @@ -10,8 +10,8 @@ class guildMemberRemoveListener extends Listener { }); } - async exec(guild) { - const leave = await leaveChannel.findOne({where: {guildID: guild.guild.id}}); + async exec(member) { + const leave = await leaveChannel.findOne({where: {guildID: member.guild.id}}); if (leave) { const channel = this.client.channels.resolve(leave.get('channelID')); @@ -19,8 +19,8 @@ class guildMemberRemoveListener extends Listener { let invite = new RegExp(/(https?:\/\/)?(www\.)?discord(?:app\.com|\.gg)[/invite/]?(?:(?!.*[Ii10OolL]).[a-zA-Z0-9]{5,6}|[a-zA-Z0-9-]{2,32})/g); - let username = guild.user.username; - let user = guild.user; + let username = member.user.username; + let user = member.user; if (username.match(invite)) { username = username.replace(/(https?:\/\/)?(www\.)?discord(?:app\.com|\.gg)[/invite/]?(?:(?!.*[Ii10OolL]).[a-zA-Z0-9]{5,6}|[a-zA-Z0-9-]{2,32})/g, '[REDACTED]'); user = username; @@ -28,7 +28,7 @@ class guildMemberRemoveListener extends Listener { byeMessage = byeMessage.replace(/\[member\]/, username); byeMessage = byeMessage.replace(/\[memberPing\]/, user); - byeMessage = byeMessage.replace(/\[server\]/, guild.guild.name); + byeMessage = byeMessage.replace(/\[server\]/, member.guild.name); let attach; if (byeMessage.includes('[attach:')) {