use attachement

Commando
loicbersier 6 years ago
parent c38c98e160
commit 0e9120bf49

@ -12,13 +12,20 @@ module.exports = class BotavatarCommand extends Command {
key: 'pic',
prompt: 'Wich avatar should i have?',
type: 'string',
default: ''
}
]
});
}
async run(message, { pic }) {
this.client.user.setAvatar(pic);
let Attachment = (message.attachments).array();
let image = null
if (!Attachment[0])
return message.say('You didint provide any images')
else
image = Attachment[0].url
this.client.user.setAvatar(image);
message.say('The avatar have been changed succesfully');
}
};
Loading…
Cancel
Save