示例#1
0
 def on_privmsg(self, msg):
     """This method should be overridden by subclass"""
     if is_channel(msg.arguments[0]):
         log.debug('Public message in channel %s received', msg.arguments[0])
     else:
         log.debug('Private message from %s received', msg.from_nick)
     raise NotImplementedError()
示例#2
0
 def on_privmsg(self, msg):
     """This method should be overridden by subclass"""
     if is_channel(msg.arguments[0]):
         log.debug('Public message in channel %s received',
                   msg.arguments[0])
     else:
         log.debug('Private message from %s received', msg.from_nick)
     raise NotImplementedError()
示例#3
0
    def on_privmsg(self, msg):
        """
        Appends messages for the specific channel in the line cache. Schedules a message processing after 1s to
        handle multiline announcements.
        :param msg: IRCMessage object
        :return:
        """
        nickname = msg.from_nick
        channel = msg.arguments[0]
        if not irc_bot.is_channel(channel):
            logger.debug('Received msg is not a channel msg: {}', msg)
            return
        # set some defaults
        self.line_cache.setdefault(channel, {})
        self.line_cache[channel].setdefault(nickname, [])

        self.line_cache[channel][nickname].append(msg.arguments[1])
        if not self.processing_message:
            # Schedule a parse of the message in 1 second (for multilines)
            self.schedule.queue_command(1, partial(self.process_message, nickname, channel))
            self.processing_message = True
示例#4
0
文件: irc.py 项目: Flexget/Flexget
    def on_privmsg(self, msg):
        """
        Appends messages for the specific channel in the line cache. Schedules a message processing after 1s to
        handle multiline announcements.
        :param msg: IRCMessage object
        :return:
        """
        nickname = msg.from_nick
        channel = msg.arguments[0]
        if not irc_bot.is_channel(channel):
            log.debug('Received msg is not a channel msg: %s', msg)
            return
        # set some defaults
        self.line_cache.setdefault(channel, {})
        self.line_cache[channel].setdefault(nickname, [])

        self.line_cache[channel][nickname].append(msg.arguments[1])
        if not self.processing_message:
            # Schedule a parse of the message in 1 second (for multilines)
            self.schedule.queue_command(1, partial(self.process_message, nickname, channel))
            self.processing_message = True