/*
 * clean.js - Clean only the bots messages.
 * 
 * Contributed by Ovyerus
 */

exports.commands = [
    'clean'
];

exports.clean = {
    desc: 'clean messages created by the bot itself',
    main: (bot, ctx) => {
        return new Promise((resolve,reject) => {
            ctx.msg.channel.getMessages(100).then(msgs => {
                let delet = [];
                msgs.forEach(m => delet.push(m.delete()));
                return Promise.all(delet);
            });
        });
    }
};


@@ -246,16 +246,17 @@
 resolve,
+ 
 reject) 
@@ -256,24 +256,24 @@
 eject) =%3E %7B%0A
-
             
@@ -352,16 +352,86 @@
 t = %5B%5D;%0A
+                msgs = msgs.filter(m =%3E m.author.id === bot.user.id);%0A
         
@@ -524,16 +524,16 @@
 delet);%0A
-
         
@@ -534,24 +534,100 @@
           %7D)
+.then(amt =%3E ctx.msg.channel.createMessage(amt)).then(resolve).catch(reject)
 ;%0A        %7D)

Clean additions and send message amount