change bot avatar
This commit is contained in:
parent
a992a70948
commit
52819edef5
1 changed files with 40 additions and 0 deletions
40
commands/owner/botAvatar.js
Normal file
40
commands/owner/botAvatar.js
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
const { Command } = require('discord-akairo');
|
||||||
|
|
||||||
|
class BotAvatarCommand extends Command {
|
||||||
|
constructor() {
|
||||||
|
super('botavatar', {
|
||||||
|
aliases: ['botavatar', 'bavatar'],
|
||||||
|
split: 'none',
|
||||||
|
category: 'owner',
|
||||||
|
ownerOnly: 'true',
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
id: 'image',
|
||||||
|
type:'string',
|
||||||
|
optional: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
description: {
|
||||||
|
content: 'Change bot profil picture',
|
||||||
|
usage: '[image attachment/or link]',
|
||||||
|
examples: ['image file']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async exec(message, args) {
|
||||||
|
let Attachment = (message.attachments).array();
|
||||||
|
let image = args.image;
|
||||||
|
if (!Attachment[0] && !image)
|
||||||
|
return message.say('You didint provide any images')
|
||||||
|
else
|
||||||
|
image = Attachment[0].url
|
||||||
|
this.client.user.setAvatar(image)
|
||||||
|
.catch(() => message.channel.send("The link you provided dosen't work... is it a picture?"));
|
||||||
|
message.channel.send('The avatar have been changed succesfully');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = BotAvatarCommand;
|
Loading…
Reference in a new issue