<commit_before>let Discord = require("discord.js");
let bot = new Discord.Client();
let config = require('./config.json');
var randomcolor = require('randomcolor')
var moment = require('moment')
var util = require('util')

process.on('uncaughtException', function(err) {
    console.log('DUD I CAUGHT EXCEPTION?!??!: ' + err); //STOPS THE BOT FROM CRASHING
});

function AaN(args, i) {
  if (args[i] === null || args[i] === "" || args[i] === undefined) return true;
  return false;
}

bot.once('ready', () => {
	let games = [`with Coding`, `I love JavaScript`, `with Chris`, `xd`,];
      setInterval(() => {
        bot.user.setGame(games[Math.floor(Math.random() * games.length)])
		console.log('Shut up I am fucking ready!');
}, 12000)
});

const prefix = "$!"

bot.on('message', msg => {
  if (msg.author.id !== bot.user.id) return; //Only allows you to work with it, since it's called a selfbot :P

  let prefix = config.prefix
  let channel = msg.channel;
  let guild = msg.guild;
  let text = msg.content;
  let args = text.split(" ");
  let command = text.substring(prefix.length, args[0].length).toLowerCase();

if (msg.content === prefix + 'cmds') {
if (!msg.guild || !msg.member) return;
   msg.channel.sendMessage(
   '```asciidoc' +
   '\n= Self Bot Commands =' +
   '\n$!ping         :: $!ping will be responed by pong and ms' +
   '\n$!learnjs      :: $!learnjs show\'s the how usefull links on leaning js' +
   '\n$!links        :: $!links show\'s my social media of John site and server' +
   '\n$!servers      :: $!servers show\'s the Verified Server\'s or the partnered server' +
   '\n$!prune        :: $!prune used to clear anywhere to 1-100 messages' +
   '\n$!uptime       :: $!uptime shows the uptime of the selfbot' +
   '\n$!reset        :: $!reset used to reset the selfbot' +
   '\n$!stats        :: $!stats used to show the selfbot stats' +
   '\n$!friend       :: $!friend <@user>  used to add friend' +
   '\n$!unfriend     :: $!unfriend <@user>  used to unfriend' +
   '\n$!block        :: $!block <@user>  used to block' +
   '\n$!unblock      :: $!unblock <@user>  used to unblock' +
   '\n$!quote        :: $!quote <message ID> used to quote message' +
   '\n$!userinfo     :: $!userinfo used to show user\'s info' +
   '\n$!whois        :: $!whois <@user> used to show user\'s info' +
   '\n$!serverinfo   :: $!serverinfo used to show server\'s info' +
   '\n$!embed        :: $!embed used for text embed <Bench role require>' +
   '\n$!softban      :: $!softban <@user>  <reason required> used to softban user\'s' +
   '\n$!warn         :: $!warn <@user> <reason required> used to warn people' +
   '\n$!ban          :: $!ban <@user>  <reason required> used to ban users' +
   '\n$!unban        :: $!unban <@user> <reason required> used to unban users' +
   '\n$!kick         :: $!kick <@user>  <reason required> used to kick users' +
   '\n$!avi          :: $!avi used to show your avatar' +
   '\n$!get          :: $!get <@user> used to get user\'s avatar' +
   '\n$!cb           :: $!cb dont feel like explaining this one' +
   '\n$!reload       :: $!reload used to reload the bot by Developer (Owner)' +
   '\n$!eval         :: $!eval used for Owner only```'
   );
}

    if (msg.content.toLowerCase().startsWith(prefix + "cb")) {
        var cb = msg.content.split(" ").slice(1).join(" ");
        msg.delete();
        msg.channel.sendMessage("```js\n" + cb + "\n```");
    }

    if (command == "afk") {
        let nickname = msg.guild.member(bot.user).nickname;
        let username = msg.guild.member(bot.user).user.username;
        if (!nickname) {
            msg.guild.member(bot.user).setNickname(username + ' [is AFK]').then(() => {
                msg.edit('Set to away from keyboard').then(response => response.delete(1000).catch(error => console.log(error.stack)));
            }).catch(error => console.log(error.stack));
        } else

        if (nickname.search(' [is AFK]')) {
            msg.guild.member(bot.user).setNickname('').then(() => {
                msg.edit('No longer AFK').then(response => response.delete(1000).catch(error => console.log(error.stack)));
            }).catch(error => console.log(error.stack));
        } else

        if (nickname && !nickname.includes(' [is AFK]')) {
            msg.guild.member(bot.user).setNickname(nickname + ' [is AFK]').then(() => {
                msg.edit('Set to Away From Keyboard').then(response => response.delete(1000).catch(error => console.log(error.stack)));
            }).catch(error => console.log(error.stack));
        } else if (nickname.search(' [is AFK]')) {
            msg.guild.member(bot.user).setNickname(nickname.replace(/ \[AFK\]/g, '')).then(() => {
                msg.edit('No longer AFK').then(response => response.delete(1000).catch(error => console.log(error.stack)));
            }).catch(error => console.log(error.stack));
        }
    }

    if (command == "ping") {
        msg.delete()
        startTime = Date.now();
        channel.sendMessage("Pinging...").then((msg) => {
            endTime = Date.now();
            msg.edit(`Pong! \`${Math.round(endTime - startTime)}ms\``);
        });
    }

    if (command == "prune") {
        var amount = parseInt(args[1]);
        msg.channel.fetchMessages({
                limit: amount
            })
            .then(messages => {
                messages.map(msg => msg.delete().catch(console.error));
            }).catch(console.error);
    } else if (command == "clear") {
        let delamount = parseInt(args[1]) ? parseInt(args[1]) : 1;
        msg.channel.fetchMessages({
                limit: 100
            })
            .then(messages => {
                msgar = messages.array();
                msgar = msgar.filter(msg => msg.author.id === bot.user.id);
                msgar.length = delamount + 1;
                msgar.map(msg => msg.delete().catch(console.error));
            });
    }
	
    if (msg.content.toLowerCase() == prefix + 'r' || msg.content.toLowerCase() == prefix + 'reload') {
        msg.channel.sendMessage(`:rocket: SelfBot is resetting, please wait. :rocket:`).then(function(t) {
            process.exit(1);
        });
    }


 if (msg.content === prefix + "stats") {
        var moment = require('moment')
        var embed = new Discord.RichEmbed();
        embed.setColor("#0099FF")
            .setFooter(' ', ' ')
            .setThumbnail(`${client.user.avatarURL}`)
            .setTimestamp()
            .addField('> Uptime', (Math.round(client.uptime / (1000 * 60 * 60))) + " hours, " + (Math.round(client.uptime / (1000 * 60)) % 60) + " minutes, and " + (Math.round(client.uptime / 1000) % 60) + " seconds")
            .addField('> General Stats', `• Servers: ${client.guilds.size}\n• Channels: ${client.channels.size}\n• Users: ${client.users.size}`, true)
            .addField('> Working on', `• New Pando\'s commands, click this [Link to join](https://discord.gg/dfdvArY)`)
            .addField('> Update', '• Added learnjs command')
        msg.channel.sendEmbed(
            embed, {
                disableEveryone: true
            }
        );
}

    if (command == "friend") {
        if (!msg.mentions.users.first()) return msg.edit('**Friend** > Failed, no user.');

        msg.mentions.users.first().addFriend().then(() => {
            msg.edit("**Friend** > Done");
        })
    }

    if (command == "unfriend") {
        if (!msg.mentions.users.first()) return msg.edit('**Friend** > Failed, no user.');

        msg.mentions.users.first().removeFriend().then(() => {
            msg.edit("**Removed Friend** > Done");
        })
    }

    if (command == "block") {
        if (!msg.mentions.users.first()) return msg.edit('**Block** > Failed, no user.');<commit_msg>reload stats<commit_after>let Discord = require("discord.js");
let bot = new Discord.Client();
let config = require('./config.json');
var randomcolor = require('randomcolor')
var moment = require('moment')
var util = require('util')

process.on('uncaughtException', function(err) {
    console.log('DUD I CAUGHT EXCEPTION?!??!: ' + err); //STOPS THE BOT FROM CRASHING
});

function AaN(args, i) {
  if (args[i] === null || args[i] === "" || args[i] === undefined) return true;
  return false;
}

bot.once('ready', () => {
	let games = [`with Coding`, `I love JavaScript`, `with Chris`, `xd`,];
      setInterval(() => {
        bot.user.setGame(games[Math.floor(Math.random() * games.length)])
		console.log('Shut up I am fucking ready!');
}, 12000)
});

const prefix = "$!"

bot.on('message', msg => {
  if (msg.author.id !== bot.user.id) return; //Only allows you to work with it, since it's called a selfbot :P

  let prefix = config.prefix
  let channel = msg.channel;
  let guild = msg.guild;
  let text = msg.content;
  let args = text.split(" ");
  let command = text.substring(prefix.length, args[0].length).toLowerCase();

if (msg.content === prefix + 'cmds') {
if (!msg.guild || !msg.member) return;
   msg.channel.sendMessage(
   '```asciidoc' +
   '\n= Self Bot Commands =' +
   '\n$!ping         :: $!ping will be responed by pong and ms' +
   '\n$!learnjs      :: $!learnjs show\'s the how usefull links on leaning js' +
   '\n$!links        :: $!links show\'s my social media of John site and server' +
   '\n$!servers      :: $!servers show\'s the Verified Server\'s or the partnered server' +
   '\n$!prune        :: $!prune used to clear anywhere to 1-100 messages' +
   '\n$!uptime       :: $!uptime shows the uptime of the selfbot' +
   '\n$!reset        :: $!reset used to reset the selfbot' +
   '\n$!stats        :: $!stats used to show the selfbot stats' +
   '\n$!friend       :: $!friend <@user>  used to add friend' +
   '\n$!unfriend     :: $!unfriend <@user>  used to unfriend' +
   '\n$!block        :: $!block <@user>  used to block' +
   '\n$!unblock      :: $!unblock <@user>  used to unblock' +
   '\n$!quote        :: $!quote <message ID> used to quote message' +
   '\n$!userinfo     :: $!userinfo used to show user\'s info' +
   '\n$!whois        :: $!whois <@user> used to show user\'s info' +
   '\n$!serverinfo   :: $!serverinfo used to show server\'s info' +
   '\n$!embed        :: $!embed used for text embed <Bench role require>' +
   '\n$!softban      :: $!softban <@user>  <reason required> used to softban user\'s' +
   '\n$!warn         :: $!warn <@user> <reason required> used to warn people' +
   '\n$!ban          :: $!ban <@user>  <reason required> used to ban users' +
   '\n$!unban        :: $!unban <@user> <reason required> used to unban users' +
   '\n$!kick         :: $!kick <@user>  <reason required> used to kick users' +
   '\n$!avi          :: $!avi used to show your avatar' +
   '\n$!get          :: $!get <@user> used to get user\'s avatar' +
   '\n$!cb           :: $!cb dont feel like explaining this one' +
   '\n$!reload       :: $!reload used to reload the bot by Developer (Owner)' +
   '\n$!eval         :: $!eval used for Owner only```'
   );
}

    if (msg.content.toLowerCase().startsWith(prefix + "cb")) {
        var cb = msg.content.split(" ").slice(1).join(" ");
        msg.delete();
        msg.channel.sendMessage("```js\n" + cb + "\n```");
    }

    if (command == "afk") {
        let nickname = msg.guild.member(bot.user).nickname;
        let username = msg.guild.member(bot.user).user.username;
        if (!nickname) {
            msg.guild.member(bot.user).setNickname(username + ' [is AFK]').then(() => {
                msg.edit('Set to away from keyboard').then(response => response.delete(1000).catch(error => console.log(error.stack)));
            }).catch(error => console.log(error.stack));
        } else

        if (nickname.search(' [is AFK]')) {
            msg.guild.member(bot.user).setNickname('').then(() => {
                msg.edit('No longer AFK').then(response => response.delete(1000).catch(error => console.log(error.stack)));
            }).catch(error => console.log(error.stack));
        } else

        if (nickname && !nickname.includes(' [is AFK]')) {
            msg.guild.member(bot.user).setNickname(nickname + ' [is AFK]').then(() => {
                msg.edit('Set to Away From Keyboard').then(response => response.delete(1000).catch(error => console.log(error.stack)));
            }).catch(error => console.log(error.stack));
        } else if (nickname.search(' [is AFK]')) {
            msg.guild.member(bot.user).setNickname(nickname.replace(/ \[AFK\]/g, '')).then(() => {
                msg.edit('No longer AFK').then(response => response.delete(1000).catch(error => console.log(error.stack)));
            }).catch(error => console.log(error.stack));
        }
    }

    if (command == "ping") {
        msg.delete()
        startTime = Date.now();
        channel.sendMessage("Pinging...").then((msg) => {
            endTime = Date.now();
            msg.edit(`Pong! \`${Math.round(endTime - startTime)}ms\``);
        });
    }

    if (command == "prune") {
        var amount = parseInt(args[1]);
        msg.channel.fetchMessages({
                limit: amount
            })
            .then(messages => {
                messages.map(msg => msg.delete().catch(console.error));
            }).catch(console.error);
    } else if (command == "clear") {
        let delamount = parseInt(args[1]) ? parseInt(args[1]) : 1;
        msg.channel.fetchMessages({
                limit: 100
            })
            .then(messages => {
                msgar = messages.array();
                msgar = msgar.filter(msg => msg.author.id === bot.user.id);
                msgar.length = delamount + 1;
                msgar.map(msg => msg.delete().catch(console.error));
            });
    }
	
    if (msg.content.toLowerCase() == prefix + 'r' || msg.content.toLowerCase() == prefix + 'reload') {
        msg.channel.sendMessage(`:rocket: SelfBot is resetting, please wait. :rocket:`).then(function(t) {
            process.exit(1);
        });
    }


 if (msg.content === prefix + "stats") {
        var moment = require('moment')
        var embed = new Discord.RichEmbed();
        embed.setColor("#0099FF")
            .setFooter(' ', ' ')
            .setThumbnail(`${bot.user.avatarURL}`)
            .setTimestamp()
            .addField('> Uptime', (Math.round(bot.uptime / (1000 * 60 * 60))) + " hours, " + (Math.round(bot.uptime / (1000 * 60)) % 60) + " minutes, and " + (Math.round(bot.uptime / 1000) % 60) + " seconds")
            .addField('> General Stats', `• Servers: ${bot.guilds.size}\n• Channels: ${bot.channels.size}\n• Users: ${bot.users.size}`, true)
            .addField('> Working on', `• New Pando\'s commands, click this [Link to join](https://discord.gg/dfdvArY)`)
            .addField('> Update', '• Added learnjs command')
        msg.channel.sendEmbed(
            embed, {
                disableEveryone: true
            }
        );
}

    if (command == "friend") {
        if (!msg.mentions.users.first()) return msg.edit('**Friend** > Failed, no user.');

        msg.mentions.users.first().addFriend().then(() => {
            msg.edit("**Friend** > Done");
        })
    }

    if (command == "unfriend") {
        if (!msg.mentions.users.first()) return msg.edit('**Friend** > Failed, no user.');

        msg.mentions.users.first().removeFriend().then(() => {
            msg.edit("**Removed Friend** > Done");
        })
    }

    if (command == "block") {
        if (!msg.mentions.users.first()) return msg.edit('**Block** > Failed, no user.');
{'fraction_non_alphanumeric': 0.18974425213123225, 'fraction_numerical': 0.008008266597778351, 'mean_word_length': 2.37070091423596, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 111, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4378052', 'n_tokens_mistral': 5086, 'n_tokens_neox': 4907, 'n_words': 1170}