Display File Formats in Avatar more accurately

This commit is contained in:
Dragon Fire
2020-07-18 08:57:14 -04:00
parent d90a7b14ad
commit 19f7ae95d9
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -1,6 +1,12 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const { embedURL } = require('../../util/Util');
const displayFmts = {
jpg: 'JPEG',
png: 'PNG',
gif: 'GIF',
webp: 'WebP'
};
module.exports = class AvatarCommand extends Command {
constructor(client) {
@@ -29,7 +35,7 @@ module.exports = class AvatarCommand extends Command {
const embed = new MessageEmbed()
.setTitle(user.tag)
.setDescription(
formats.map(fmt => embedURL(fmt.toUpperCase(), user.displayAvatarURL({ format: fmt, size: 2048 }))).join(' | ')
formats.map(fmt => embedURL(displayFmts[fmt], user.displayAvatarURL({ format: fmt, size: 2048 }))).join(' | ')
)
.setImage(user.displayAvatarURL({ format, size: 2048 }))
.setColor(0x00AE86);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.18.1",
"version": "119.18.2",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {