<commit_before>from pathlib import Path
from os.path import isfile


class ERRORBOT:

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

    async def error(self, channel, message):
        if isfile(Path(
                self.bot.DATA_FOLDER,
                f'{self.bot.name}.error.png')):
            await self.bot.client.send_file(channel, Path(
                self.bot.DATA_FOLDER,
                f'{self.bot.name}.error.png'))
        return await self.bot.message(channel, message)


def setup(bot):
    ERRORBOT(bot)<commit_msg>Error message doesn't have a race condition now.<commit_after>from pathlib import Path
from os.path import isfile


class ERRORBOT:

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

    async def error(self, channel, message):
        if isfile(Path(
                self.bot.DATA_FOLDER,
                f'{self.bot.name}.error.png')):
            return await self.bot.client.send_file(channel, Path(
                self.bot.DATA_FOLDER,
                f'{self.bot.name}.error.png'), content=message)
        else:
            return await self.bot.message(channel, message)


def setup(bot):
    ERRORBOT(bot)
{'fraction_non_alphanumeric': 0.10966693744922827, 'fraction_numerical': 0.0, 'mean_word_length': 2.0954773869346734, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2452677', 'n_tokens_mistral': 389, 'n_tokens_neox': 371, 'n_words': 85}