forked from Supositware/Haha-Yes
use attachement
This commit is contained in:
parent
c38c98e160
commit
0e9120bf49
1 changed files with 8 additions and 1 deletions
|
@ -12,13 +12,20 @@ module.exports = class BotavatarCommand extends Command {
|
||||||
key: 'pic',
|
key: 'pic',
|
||||||
prompt: 'Wich avatar should i have?',
|
prompt: 'Wich avatar should i have?',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(message, { pic }) {
|
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');
|
message.say('The avatar have been changed succesfully');
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in a new issue