From 46f5e6f47b4314557686183a2586037925b792b8 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 24 Sep 2018 01:01:07 +0000 Subject: [PATCH] Improve avatar command --- commands/info/avatar.js | 12 +++++++++++- package.json | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/commands/info/avatar.js b/commands/info/avatar.js index ae9b8510..2d57b371 100644 --- a/commands/info/avatar.js +++ b/commands/info/avatar.js @@ -1,4 +1,5 @@ const Command = require('../../structures/Command'); +const { MessageEmbed } = require('discord.js'); module.exports = class AvatarCommand extends Command { constructor(client) { @@ -20,7 +21,16 @@ module.exports = class AvatarCommand extends Command { } run(msg, { user }) { + const formats = ['webp', 'png', 'jpg']; const format = user.avatar && user.avatar.startsWith('a_') ? 'gif' : 'png'; - return msg.say(user.displayAvatarURL({ format, size: 2048 })); + if (format === 'gif') formats.push('gif'); + const embed = new MessageEmbed() + .setTitle(user.tag) + .setDescription( + formats.map(fmt => `[${fmt.toUpperCase()}](${user.displayAvatarURL({ format: fmt, size: 2048 })})`).join(' | ') + ) + .setImage(user.displayAvatarURL({ format, size: 2048 })) + .setColor(0x00AE86); + return msg.embed(embed); } }; diff --git a/package.json b/package.json index 22a1dea2..43051e5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "91.10.2", + "version": "91.10.3", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {