<commit_before>#!/usr/bin/python3
# -*- coding: utf-8 -*-
import discord
import os
import re
from wow import *


DISCORD_BOT_TOKEN = str(os.environ.get('DISCORD_BOT_TOKEN'))
client = discord.Client()


@client.event
async def on_message(message):
    """Listens for specific user messages."""

    # If the author is the bot do nothing.
    if message.author == client.user:
        return

    # If it's not the bot and the message starts with '!armory' process it.
    if message.content.startswith('!armory'):
        # Splits up the message, requires the user to type their message as '!wow Jimo burning-legion'.
        # Sends the second word (name) and third word (realm) to the characterInfo function to build a character sheet.
        split = message.content.split(" ")
        info = characterInfo(split[1], split[2])

        # If the returned data is an empty string send a message saying the player/realm couldn't be found.
        if info == '':
            msg = 'Could not find a player with that name/realm combination.'.format(message)
            await client.send_message(message.channel, msg)
        # Otherwise respond with an incredibly long string of data holding all of the info.
        else:
            colour_code = classColour(info['class_type'])
            msg = discord.Embed(title="%s" % (info['name']), colour=discord.Colour(colour_code), url="%s" % (info['armory']), description="%s" % (info['realm']))

            msg.set_thumbnail(url="https://render-%s.worldofwarcraft.com/character/%s" % (WOW_REGION, info['thumb']))
            msg.set_footer(text="Generated by WoW Armory Bot - https://jamesiv.es", icon_url="https://github.com/JamesIves/discord-wow-armory-bot/blob/master/assets/icon.jpg?raw=true")

            msg.add_field(name="Character", value="**Character** %s\n**Realm** %s\n**Item Level** %s" % (info['name'], info['realm'], info['ilvl']), inline=True)


            await client.send_message(message.channel, embed=msg)


client.run(DISCORD_BOT_TOKEN)<commit_msg>Updating to embed<commit_after>#!/usr/bin/python3
# -*- coding: utf-8 -*-
import discord
import os
import re
from wow import *


DISCORD_BOT_TOKEN = str(os.environ.get('DISCORD_BOT_TOKEN'))
client = discord.Client()


@client.event
async def on_message(message):
    """Listens for specific user messages."""

    # If the author is the bot do nothing.
    if message.author == client.user:
        return

    # If it's not the bot and the message starts with '!armory' process it.
    if message.content.startswith('!armory'):
        # Splits up the message, requires the user to type their message as '!wow Jimo burning-legion'.
        # Sends the second word (name) and third word (realm) to the characterInfo function to build a character sheet.
        split = message.content.split(" ")
        info = characterInfo(split[1], split[2])

        # If the returned data is an empty string send a message saying the player/realm couldn't be found.
        if info == '':
            msg = 'Could not find a player with that name/realm combination.'.format(message)
            await client.send_message(message.channel, msg)
        # Otherwise respond with an incredibly long string of data holding all of the info.
        else:
            colour_code = classColour(info['class_type'])
            embed = discord.Embed(title="%s" % (info['name']), colour=discord.Colour(colour_code), url="%s" % (info['armory']), description="%s" % (info['realm']))

            embed.set_thumbnail(url="https://render-%s.worldofwarcraft.com/character/%s" % (WOW_REGION, info['thumb']))
            embed.set_footer(text="Generated by WoW Armory Bot - https://jamesiv.es", icon_url="https://github.com/JamesIves/discord-wow-armory-bot/blob/master/assets/icon.jpg?raw=true")

            embed.add_field(name="Character", value="**Character** %s\n**Realm** %s\n**Item Level** %s" % (info['name'], info['realm'], info['ilvl']), inline=True)


            await client.send_message(message.channel, embed=embed)


client.run(DISCORD_BOT_TOKEN)
{'fraction_non_alphanumeric': 0.1372161895360316, 'fraction_numerical': 0.0019743336623889436, 'mean_word_length': 3.3533834586466167, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '4236958', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1224, 'n_words': 343}