Send guild pfp if it exists
This commit is contained in:
parent
d26106344f
commit
1eeb0976f9
1 changed files with 9 additions and 2 deletions
|
@ -4,7 +4,8 @@ module.exports = {
|
||||||
name: 'pfp',
|
name: 'pfp',
|
||||||
description: 'Returns profile picture',
|
description: 'Returns profile picture',
|
||||||
moreHelp: ["Returns your profile picture if no arguments are provided",
|
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}) {
|
execute({message, args}) {
|
||||||
let info;
|
let info;
|
||||||
if (!args[0]) {
|
if (!args[0]) {
|
||||||
|
@ -13,7 +14,13 @@ module.exports = {
|
||||||
info = parseMention(args[0], message.guild);
|
info = parseMention(args[0], message.guild);
|
||||||
}
|
}
|
||||||
let user = message.guild.members.cache.get(info);
|
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)
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Add table
Reference in a new issue