Change avatar to get from message author if no user is mentioned
This commit is contained in:
parent
17969f62a8
commit
978ccc3231
|
@ -2,15 +2,17 @@ module.exports = {
|
||||||
name: "avatar",
|
name: "avatar",
|
||||||
description: "Gets a users avatar.",
|
description: "Gets a users avatar.",
|
||||||
execute(client, message, args) {
|
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 = {
|
const embed = {
|
||||||
"title": ":frame_photo: " + user.username + "'s Avatar",
|
"title": ":frame_photo: " + user.username + "'s Beautiful Avatar!",
|
||||||
"description": "Here is " + user.username + "'s avatar!",
|
|
||||||
"color": 9442302,
|
"color": 9442302,
|
||||||
"footer": {
|
"footer": {
|
||||||
"icon_url": "https://media.discordapp.net/attachments/549707869138714635/793524910172667964/Screenshot_26.png",
|
"icon_url": message.author.displayAvatarURL(),
|
||||||
"text": "Made with ❤ in Illinois | Anitrox © IDeletedSystem64 2018-2021"
|
"text": footerTxt
|
||||||
},
|
},
|
||||||
"image": {
|
"image": {
|
||||||
"url": user.displayAvatarURL()
|
"url": user.displayAvatarURL()
|
||||||
|
|
Reference in New Issue