discord_bot/commands/pfp.js
SileNce5k c51a4fa976
Pass objects on command.execute
Pass objects instead of using a switch statement.
Now I don't have to restart the bot whenever I add a new command
that needs specific arguments other than 'message'.
2021-03-09 18:50:27 +01:00

18 lines
No EOL
507 B
JavaScript

const parseMention = require("../util/parseMention.js")
module.exports = {
name: 'pfp',
description: 'Returns profile picture',
execute({message, args}) {
let info;
if (!args[0]) {
info = message.author.id;
} else {
info = parseMention(args[0], message.guild);
console.log(info)
}
let user = message.guild.members.cache.get(info);
message.channel.send(user.user.avatarURL({ format: 'png', dynamic: true, size: 4096 }))
}
};