<commit_before>import time

from .config import BOT_ID, AT_BOT, READ_WEBSOCKET_DELAY, SLACK_CLIENT
from .query_handler import ContactQuery


class MessageTriage(object):

    def __init__(self, message, query_handler=None):

        self.message = message
        self.query_handler = query_handler
        self.command_queries = {'vote': None,
                                'contact': ContactQuery}

    def process_query(self):
        """Run query and return query handler, reply, and attachment."""

        if self.query_handler:

            query_handler = self.query_handler

        else:
            query_handler = ContactQuery()

        reply = query_handler.run_query(self.message.strip(':'))
        return query_handler, reply


class BillyBot(object):

    def __init__(self):
        self.active_queries = dict()

    def handle_command(self, user_id, username, command, channel):
        """Triage message and prepare reply to send."""

        active_query = self.active_queries.get(user_id)

        triage = MessageTriage(command, active_query)
        query_handler, reply = triage.process_query()

        if not query_handler.PENDING:
            self.active_queries[user_id] = None
        else:<commit_msg>Remove command_queries instance variable from billybot.MessageTriage<commit_after>import time

from .config import BOT_ID, AT_BOT, READ_WEBSOCKET_DELAY, SLACK_CLIENT
from .query_handler import ContactQuery


class MessageTriage(object):

    def __init__(self, message, query_handler=None):

        self.message = message
        self.query_handler = query_handler

    def process_query(self):
        """Run query and return query handler, reply, and attachment."""

        if self.query_handler:

            query_handler = self.query_handler

        else:
            query_handler = ContactQuery()

        reply = query_handler.run_query(self.message.strip(':'))
        return query_handler, reply


class BillyBot(object):

    def __init__(self):
        self.active_queries = dict()

    def handle_command(self, user_id, username, command, channel):
        """Triage message and prepare reply to send."""

        active_query = self.active_queries.get(user_id)

        triage = MessageTriage(command, active_query)
        query_handler, reply = triage.process_query()

        if not query_handler.PENDING:
            self.active_queries[user_id] = None
        else:
{'fraction_non_alphanumeric': 0.08587943848059455, 'fraction_numerical': 0.0, 'mean_word_length': 2.8706070287539935, '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': '469834', 'n_tokens_mistral': 695, 'n_tokens_neox': 669, 'n_words': 167}