From 1eeb0976f99f3a332094109ae07a39ce3b465542 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Tue, 3 May 2022 08:10:42 +0200 Subject: [PATCH] Send guild pfp if it exists --- commands/info/pfp.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/commands/info/pfp.js b/commands/info/pfp.js index d4de667..68a4640 100644 --- a/commands/info/pfp.js +++ b/commands/info/pfp.js @@ -4,7 +4,8 @@ module.exports = { name: 'pfp', description: 'Returns profile picture', moreHelp: ["Returns your profile picture if no arguments are provided", - "Argument can be username, nickname, userid, and mention"], + "Argument can be username, nickname, userid, and mention", + "If the user has a pfp for the current guild, it will be returned as well"], execute({message, args}) { let info; if (!args[0]) { @@ -13,7 +14,13 @@ module.exports = { info = parseMention(args[0], message.guild); } let user = message.guild.members.cache.get(info); + let guildPfp = user.avatarURL({format: 'png', dynamic: true, size: 4096}); + let globalPfp = user.user.avatarURL({format: 'png', dynamic: true, size: 4096}); + let sendText = `Global pfp:\n${globalPfp}`; + if(guildPfp != null){ + sendText = `${sendText}\nGuild pfp:\n${guildPfp}`; + } - message.channel.send(user.user.avatarURL({ format: 'png', dynamic: true, size: 4096 })) + message.channel.send(sendText) } }; \ No newline at end of file