<commit_before>var Discord = require('discord.io');
var request = require('request');

// Define the bot instance
var bot = new Discord.Client({
    autorun: true,
    token: ""
});

// Reconnect the bot if they somehow get disconnected
bot.on('disconnect', function(errMsg, code) {
  bot.connect()
});

// Make sure the emojis are fresh from the repo
function getEmojiFonts(){
  request('https://github.com/haykam821/Discord-Font-Service/raw/master/index.json', function (error, response, body) {
    if (!error && response.statusCode == 200) {
       importedJSON = JSON.parse(body);
       fonts = importedJSON['fonts'];
       config = importedJSON['config'];
    }
  })
};

setInterval(getEmojiFonts,3000);

// Define fonts in case it hasn't loaded yet
var fonts = {};

// Define a function to convert from text to letter emoji
function parseToEmoji(cmd, message) {
  try {
    array = message.toLowerCase().replace(cmd + ' ', '').split(' ');
    font = fonts[message.replace('font:', '').split(' ')[message.split(' ').length - 1]] == undefined ? fonts['default'] : fonts[message.replace('font:', '').split(' ')[message.split(' ').length - 1]]
    // Font setup
    if (array[array.length - 1].startsWith('font:')) {
        array.pop();
    } else {
        font = fonts['default'];
    };
    fontname = array[i];
    // Fix array again
    array = array.join(' ').split('');
    // Convert to emoji!
    if (fontname == 'bee') {
      for (var i = 0; i < array.length; i++) {
          if (i % 2 == 0) {
            array[i] = font['emojis']['black'] == undefined ? array[i] : font['emojis']['black']
          } else {
            array[i] = font['emojis']['yellow'] == undefined ? array[i] : font['emojis']['yellow']
          }
      }
    } else {
      for (var i = 0; i < array.length; i++) {
          array[i] = font['emojis'][array[i]] == undefined ? array[i] : font['emojis'][array[i]]
      }
    }
    return {
      font: font == fonts['default'] ? `Default (${fonts.default['font_name']})` : font['font_name'],
      text: array.join('‌'),
      color: parseInt(font['color']) == undefined ? config['fallback_color'] : parseInt(font['color'])<commit_msg>Updated the function to include a working bee semi-font<commit_after>var Discord = require('discord.io');
var request = require('request');

// Define the bot instance
var bot = new Discord.Client({
    autorun: true,
    token: ""
});

// Reconnect the bot if they somehow get disconnected
bot.on('disconnect', function(errMsg, code) {
  bot.connect()
});

// Make sure the emojis are fresh from the repo
function getEmojiFonts(){
  request('https://github.com/haykam821/Discord-Font-Service/raw/master/index.json', function (error, response, body) {
    if (!error && response.statusCode == 200) {
       importedJSON = JSON.parse(body);
       fonts = importedJSON['fonts'];
       config = importedJSON['config'];
    }
  })
};

setInterval(getEmojiFonts,3000);

// Define fonts in case it hasn't loaded yet
var fonts = {};

// Define a function to convert from text to letter emoji
function parseToEmoji(cmd, message) {
  try {
    array = message.toLowerCase().replace(cmd + ' ', '').split(' ');
    fontid = fonts[message.replace('font:', '').split(' ')[message.split(' ').length - 1]] == (undefined||'bee') ? 'default' : message.replace('font:', '').split(' ')[message.split(' ').length - 1];

    font = fonts[fontid];
    // Font setup
    if (array[array.length - 1].startsWith('font:')) {
        array.pop();
    } else {
        font = fonts['default'];
    };
    // Fix array again
    array = array.join(' ').split('');
    // Convert to emoji!
    if (fontid == 'bee'){
      for (var i = 0; i < array.length; i++) {
          if (i % 2 == 0) {
            array[i] = fonts['yellow']['emojis'][array[i]] == undefined ? array[i] : fonts['yellow']['emojis'][array[i]];
          } else {
            array[i] = fonts['black']['emojis'][array[i]] == undefined ? array[i] : fonts['black']['emojis'][array[i]];
          }
      }
    } else {
      for (var i = 0; i < array.length; i++) {
          console.log(font['emojis'][array[i]])
          array[i] = font['emojis'][array[i]] == undefined ? array[i] : font['emojis'][array[i]]
      }
    }
    return {
      font: font == fonts['default'] ? `Default (${fonts.default['font_name']})` : font['font_name'],
      text: array.join('‌'),
      color: parseInt(font['color']) == undefined ? config['fallback_color'] : parseInt(font['color'])
{'fraction_non_alphanumeric': 0.1955406911928651, 'fraction_numerical': 0.00758082497212932, 'mean_word_length': 3.085610200364299, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '162822', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1441, 'n_words': 344}