Haha-Yes/commands/owner/botAvatar.js

31 lines
964 B
JavaScript
Raw Normal View History

const { Command } = require('discord.js-commando');
2018-09-08 00:22:38 +02:00
module.exports = class BotavatarCommand extends Command {
constructor(client) {
super(client, {
2018-09-08 00:22:38 +02:00
name: 'botavatar',
group: 'owner',
2018-09-08 00:22:38 +02:00
memberName: 'botavatar',
description: 'Change the avatar of the bot',
ownerOnly: true,
args: [
{
key: 'pic',
prompt: 'Wich avatar should i have?',
type: 'string',
2018-10-14 17:38:45 +02:00
default: ''
}
]
});
}
2018-09-09 21:32:08 +02:00
async run(message, { pic }) {
2018-10-14 17:38:45 +02:00
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);
2018-09-09 21:32:08 +02:00
message.say('The avatar have been changed succesfully');
}
};