from __future__ import unicode_literals

from twsslib import TWSSlib

from rtmbot.core import Plugin


class TWSS(Plugin):

    def __init__(self,name='TWSS',slack_client=None, plugin_config=None):
        super(TWSS,self).__init__(name=name,slack_client=slack_client, plugin_config=plugin_config)
        self.nbc = TWSSlib()
        self.nbc.train()

    def catch_all(self, data):
        print(data)

    def process_message(self, data):
        if self.nbc.is_twss(data['text'],.7):
            self.outputs.append([data['channel'], 'TWSS'])
