Change avatar to get from message author if no user is mentioned

This commit is contained in:
IDeletedSystem64 2022-03-21 10:37:04 -05:00
parent 17969f62a8
commit 978ccc3231
1 changed files with 7 additions and 5 deletions

View File

@ -2,15 +2,17 @@ module.exports = {
name: "avatar",
description: "Gets a users avatar.",
execute(client, message, args) {
const user = message.mentions.users.first()
user = message.mentions.users.first()
if (!user) user = message.author
const {footerTxt} = require('../config.json');
const embed = {
"title": ":frame_photo: " + user.username + "'s Avatar",
"description": "Here is " + user.username + "'s avatar!",
"title": ":frame_photo: " + user.username + "'s Beautiful Avatar!",
"color": 9442302,
"footer": {
"icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png",
"text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021"
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
},
"image": {
"url": user.displayAvatarURL()