fixed the command, i think

This commit is contained in:
Supositware 2019-04-01 01:51:48 +02:00
parent 857fde935a
commit 666477a152

View file

@ -10,7 +10,6 @@ class BotAvatarCommand extends Command {
{ {
id: 'image', id: 'image',
type:'string', type:'string',
optional: true,
match: 'rest' match: 'rest'
} }
], ],
@ -27,6 +26,11 @@ class BotAvatarCommand extends Command {
let image = args.image; let image = args.image;
if (!Attachment[0] && !image) if (!Attachment[0] && !image)
return message.say('You didint provide any images'); return message.say('You didint provide any images');
else if (image && !Attachment[0]) {
this.client.user.setAvatar(image)
.catch(() => message.channel.send('The link you provided dosen\'t work... is it a picture?'));
return message.channel.send('The avatar have been changed succesfully');
}
else else
image = Attachment[0].url; image = Attachment[0].url;