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

        nick, _, host = user.partition('!')
        message = message.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': message}}
        else:
            event_data = {'type': 'message', 'scope': 'public', 'channel': channel, 'meta': {'from': user,
                                                                                             'body': message}}

        self._bot_process_event(event_data)
def privmsg ( self , user , channel , message ) : log . msg ( 'privmsg - user: {0!r}, channel: {1!r}, msg: {2!r}' . format ( user , channel , message ) , logLevel = logging . DEBUG ) nick , _ , host = user . partition ( '!' ) message = message . 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' : message } } else : event_data = { 'type' : 'message' , 'scope' : 'public' , 'channel' : channel , 'meta' : { 'from' : user , 'body' : message } } self . _bot_process_event ( event_data )