You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/owner/botAvatar.js

31 lines
964 B
JavaScript

const { Command } = require('discord.js-commando');
module.exports = class BotavatarCommand extends Command {
constructor(client) {
super(client, {
name: 'botavatar',
group: 'owner',
memberName: 'botavatar',
description: 'Change the avatar of the bot',
ownerOnly: true,
args: [
{
key: 'pic',
prompt: 'Wich avatar should i have?',
type: 'string',
default: ''
}
]
});
}
async run(message, { 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');
}
};