<commit_before>'use strict';
const Bluebird = require('bluebird'),
	Discord = require('discord.js'),
	DnDBeyond = require('./dndbeyond'),
	upndown = require('upndown');

const bot = new Discord.Client();
const dndClient = new DnDBeyond();
const und = new upndown();

if(!String.prototype.capitalize) {
	String.prototype.capitalize = function() {
		return this.charAt(0).toUpperCase() + this.slice(1);
	}
}

bot.on('ready', function() {
	console.log('Logged in as %s - %s\n', bot.user.username, bot.user.id);
});

bot.on('message', function(message) {
	if(message.content.indexOf('?roll')) {
		message.reply(rollCheck(message.content));
	}
	
	if(message.content.indexOf('?dndbot') === 0) {
		message.reply(
			'Commands: \n' +
			'?roll < dice descriptions >' +
			'\n\t e.g. ?roll 1d20+5, or ?roll 2d10 + 1d4' +
			'\n\n?spell < spell name or search string >' +
			'\n\t e.g. ?spell magic-missile or ?spell Find Familiar'
		);
	}
	
	if(message.content.indexOf('?spell') === 0) {
		message.channel.startTyping();
		findSpell(message.content)
			.finally(() => {
				message.channel.stopTyping();
			})
			.then(result => {
				if(result instanceof Discord.RichEmbed) {
					return message.reply({ embed: result });
				} else {
					return message.reply(result);
				}
			})
			.catch((e) => {
				console.log(e);
			})
	}<commit_msg>[FIX] Properly checked for roll.<commit_after>'use strict';
const Bluebird = require('bluebird'),
	Discord = require('discord.js'),
	DnDBeyond = require('./dndbeyond'),
	upndown = require('upndown');

const bot = new Discord.Client();
const dndClient = new DnDBeyond();
const und = new upndown();

if(!String.prototype.capitalize) {
	String.prototype.capitalize = function() {
		return this.charAt(0).toUpperCase() + this.slice(1);
	}
}

bot.on('ready', function() {
	console.log('Logged in as %s - %s\n', bot.user.username, bot.user.id);
});

bot.on('message', function(message) {
	if(message.content.indexOf('?roll') === 0) {
		message.reply(rollCheck(message.content));
	}
	
	if(message.content.indexOf('?dndbot') === 0) {
		message.reply(
			'Commands: \n' +
			'?roll < dice descriptions >' +
			'\n\t e.g. ?roll 1d20+5, or ?roll 2d10 + 1d4' +
			'\n\n?spell < spell name or search string >' +
			'\n\t e.g. ?spell magic-missile or ?spell Find Familiar'
		);
	}
	
	if(message.content.indexOf('?spell') === 0) {
		message.channel.startTyping();
		findSpell(message.content)
			.finally(() => {
				message.channel.stopTyping();
			})
			.then(result => {
				if(result instanceof Discord.RichEmbed) {
					return message.reply({ embed: result });
				} else {
					return message.reply(result);
				}
			})
			.catch((e) => {
				console.log(e);
			})
	}
{'fraction_non_alphanumeric': 0.19249349684132294, 'fraction_numerical': 0.010033444816053512, 'mean_word_length': 3.625429553264605, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '6994395', 'n_tokens_mistral': 1107, 'n_tokens_neox': 981, 'n_words': 187}