(self, user, channel, data)
handle a new msg on irc
handle a new msg on irc
handle a new msg on irc
def action(self, user, channel, data):
        """
        handle a new msg on irc
        """
        log.msg('action - user: {0!r}, channel: {1!r}, data: {2!r}'.format(user, channel, data), logLevel=logging.DEBUG)

        nick, _, host = user.partition('!')
        data = data.strip()

        # parse if we're the owner / message was to bot directly
        if channel == self.nickname:
            event_data = {'type': 'message', 'scope': 'private', 'meta': {'from': user, 'body': data, 'emote': True}}
        else:
            event_data = {'type': 'message', 'scope': 'public', 'channel': channel, 'meta': {'from': user, 'body': data,
                                                                                             'emote': True}}

        self._bot_process_event(event_data)
def action ( self , user , channel , data ) : log . msg ( 'action - user: {0!r}, channel: {1!r}, data: {2!r}' . format ( user , channel , data ) , logLevel = logging . DEBUG ) nick , _ , host = user . partition ( '!' ) data = data . strip ( ) # parse if we're the owner / message was to bot directly if channel == self . nickname : event_data = { 'type' : 'message' , 'scope' : 'private' , 'meta' : { 'from' : user , 'body' : data , 'emote' : True } } else : event_data = { 'type' : 'message' , 'scope' : 'public' , 'channel' : channel , 'meta' : { 'from' : user , 'body' : data , 'emote' : True } } self . _bot_process_event ( event_data )