<commit_before>/**
 * @file guildBanAdd event
 * @author <NAME> (a.k.a k3rn31p4nic)
 * @license MIT
 */

module.exports = (guild, user) => {
  guild.client.emit('serverLog', guild.client, guild, 'guildBanAdd', {
    guild: guild,
    user: user
  });
};<commit_msg>Added guildBanAdd log code to event listner<commit_after>/**
 * @file guildBanAdd event
 * @author <NAME> (a.k.a k3rn31p4nic)
 * @license MIT
 */

module.exports = async (guild, user) => {
  try {
    let guildSettings = await guild.client.db.get(`SELECT log FROM guildSettings WHERE guildID=${guild.id}`);
    if (!guildSettings || !guildSettings.log) return;

    let logChannel = guild.channels.get(guildSettings.log);
    if (!logChannel) return;

    logChannel.send({
      embed: {
        color: guild.client.colors.RED,
        title: 'User Banned',
        fields: [
          {
            name: 'User',
            value: user.tag,
            inline: true
          },
          {
            name: 'User ID',
            value: user.id,
            inline: true
          }
        ],
        timestamp: new Date()
      }
    }).catch(e => {
      guild.client.log.error(e);
    });
  }
  catch (e) {
    guild.client.log.error(e);
  }
};
{'fraction_non_alphanumeric': 0.15024630541871922, 'fraction_numerical': 0.006568144499178982, 'mean_word_length': 2.1017811704834606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, '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': '3998447', 'n_tokens_mistral': 425, 'n_tokens_neox': 405, 'n_words': 90}