import { Command, CommandoMessage } from 'discord.js-commando'; import { MessageEmbed } from 'discord.js'; import emoji from 'emoji-random'; module.exports = class PFPServer extends Command { constructor(client) { super(client, { name: 'pfp', aliases: [ 'profilepicture', 'profile-picture', 'profileimage', 'profile-image', 'avatar', 'avi' ], group: 'user', memberName: 'pfp', description: 'Grabs the profile picture of a specified user.', args: [ { key: 'userID', prompt: 'Which user\'s profile picture would you like to grab?', type: 'string' } ], examples: ['uwu!pfp @sin#1337'], throttling: { usages: 5, duration: 30 }, guildOnly: true }); } run(msg: CommandoMessage, { userID } ) { userID = msg.mentions.users.first()?.id; this.client.users.fetch(userID).then(user => { let emb = new MessageEmbed() .setColor(0xFFCC4D) .setTitle(`${msg.mentions.users.first()?.username}'s Profile Picture ` + emoji.random()) .setImage(user.avatarURL()) msg.say(emb) }) } };