<commit_before>"""Handles mointoring of text channels"""
from core.channel_reader_core import check_message, check_message_startwith, \
    bot_id, bot_nick, clean_message, linux_meme, interject
from core.program_o import chat_response


class ChannelReader:
    """
    Channel reading functions
    """

    def __init__(self, bot):
        self.bot = bot

    async def on_message(self, message):
        """
        Events for read messages
        :param message: A discord message
        :type message: disord.message
        :return: nothing
        :rtype: None
        """
        # Respnods to /o/ and \o\
        if check_message(self.bot, message, '/o/'):
            await self.bot.send_message(message.channel, '\\o\\')
        elif check_message(self.bot, message, '\\o\\'):
            await self.bot.send_message(message.channel, '/o/')
        elif check_message(self.bot, message, 'o7'):  # Yousoro!
            await self.bot.send_message(message.channel,
                                        'http://i.imgur.com/Pudz3G4.gif')
        elif check_message_startwith(self.bot, message, bot_id(self.bot)) or \
                check_message_startwith(self.bot, message, bot_nick(self.bot)):
            prefix = bot_id(self.bot) \
                if check_message_startwith(
                self.bot, message, bot_id(self.bot)) else bot_nick(self.bot)
            cleaned = clean_message(message, prefix)
            if linux_meme(cleaned):
                await self.bot.send_message(message.channel, interject())
            else:
                res = chat_response(cleaned, message.author.id)
                await self.bot.send_message(message.channel, res)
<commit_msg>formatting<commit_after>"""Handles mointoring of text channels"""
from core.channel_reader_core import check_message, check_message_startwith, \
    bot_id, bot_nick, clean_message, linux_meme, interject
from core.program_o import chat_response


class ChannelReader:
    """
    Channel reading functions
    """

    def __init__(self, bot):
        self.bot = bot

    async def on_message(self, message):
        """
        Events for read messages
        :param message: A discord message
        :type message: disord.message
        :return: nothing
        :rtype: None
        """
        # Respnods to /o/ and \o\
        if check_message(self.bot, message, '/o/'):
            await self.bot.send_message(message.channel, '\\o\\')
        elif check_message(self.bot, message, '\\o\\'):
            await self.bot.send_message(message.channel, '/o/')
        elif check_message(self.bot, message, 'o7'):  # Yousoro!
            await self.bot.send_message(message.channel,
                                        'http://i.imgur.com/Pudz3G4.gif')
        elif check_message_startwith(self.bot, message, bot_id(self.bot)) or \
                check_message_startwith(self.bot, message, bot_nick(self.bot)):
            prefix = bot_id(self.bot) \
                if check_message_startwith(
                self.bot, message, bot_id(self.bot)) else bot_nick(self.bot)
            cleaned = clean_message(message, prefix)
            if linux_meme(cleaned):
                await self.bot.send_message(message.channel, interject())
            else:
                res = chat_response(cleaned, message.author.id)
                await self.bot.send_message(message.channel, res)
{'fraction_non_alphanumeric': 0.1099290780141844, 'fraction_numerical': 0.0017730496453900709, 'mean_word_length': 2.187382297551789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1167486', 'n_tokens_mistral': 995, 'n_tokens_neox': 980, 'n_words': 216}