From 52819edef515ed3a4c14fd272c471e21ea868206 Mon Sep 17 00:00:00 2001
From: Loic Bersier <loic.bersier1@gmail.com>
Date: Sun, 30 Dec 2018 03:39:49 +0100
Subject: [PATCH] change bot avatar

---
 commands/owner/botAvatar.js | 40 +++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 commands/owner/botAvatar.js

diff --git a/commands/owner/botAvatar.js b/commands/owner/botAvatar.js
new file mode 100644
index 00000000..c151cb16
--- /dev/null
+++ b/commands/owner/botAvatar.js
@@ -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;
\ No newline at end of file