From 868779edf745393bfe9ebaa7cc6c3e029ce2d52b Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 29 Nov 2019 22:04:26 +0100 Subject: [PATCH] fix(?) the nickname --- commands/fun/fakebot.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/fun/fakebot.js b/commands/fun/fakebot.js index 59bf160..8fe460b 100644 --- a/commands/fun/fakebot.js +++ b/commands/fun/fakebot.js @@ -36,13 +36,16 @@ class fakebotCommand extends Command { let Attachment = (message.attachments).array(); let url; let username = args.user.username; + let member = message.guild.members.get(args.user.id); // Get attachment link if (Attachment[0]) { url = Attachment[0].url; } // Show nickname if user is in guild - if (message.guild.members.get(args.user.id).nickname) { - username = message.guild.members.get(args.user.id).nickname; + if (member) { + if (member.nickname) { + username = member.nickname; + } } message.channel.createWebhook(username, {