Exemplo n.º 1
0
    def on_message(self, sender, channel, flags, message, private):
        req = Request(message=message)
        req.nick = sender.nickname
        req.private = private
        req.silc_sender = sender
        if private:
            req.addressed = True
            req.sendto = sender
            req.channel = u'privmsg'
        else:
            req.addressed = False
            req.sendto = channel
            req.channel = channel.channel_name

        req.message = decode(req.message)
        req.message = self.colorlib.strip_color(req.message)
        self.check_addressing(req)

        if req.message.startswith(u'^'):
            req.message = req.message[1:]
            req.colorize = True
        else:
            req.colorize = False

        self.process_message(req)
Exemplo n.º 2
0
    def on_message(self, server, event, private, action=False):
        """process incoming messages"""
        req = Request(message=event.arguments()[0])
        req.nick = irclib.nm_to_n(event.source())
        req.channel = event.target()
        req.private = private
        req.action = action

        if private:
            req.sendto = req.nick
            req.addressed = True
        else:
            req.sendto = req.channel
            req.addressed = False

        req.message = req.message.decode(settings.ENCODING, 'replace')

        # strip control codes from incoming lines
        req.message = self.colorlib.strip_color(req.message)

        # strip adressing and set req attributes
        self.check_addressing(req)

        # lines that start with ^ will have their output rainbowed
        if req.message.startswith(u'^'):
            req.message = req.message[1:]
            req.colorize = True
        else:
            req.colorize = False

        # send to bot subsystem for processing
        self.process_message(req)
Exemplo n.º 3
0
    def on_message(self, server, event, private, action=False):
        """process incoming messages"""
        req = Request(message=event.arguments()[0])
        req.nick = irclib.nm_to_n(event.source())
        req.channel = event.target()
        req.private = private
        req.action = action

        if private:
            req.sendto = req.nick
            req.addressed = True
        else:
            req.sendto = req.channel
            req.addressed = False

        req.message = decode(req.message)

        # strip control codes from incoming lines
        req.message = self.colorlib.strip_color(req.message)

        # strip adressing and set req attributes
        self.check_addressing(req)

        # lines that start with ^ will have their output rainbowed
        if req.message.startswith(u'^'):
            req.message = req.message[1:]
            req.colorize = True
        else:
            req.colorize = False

        # send to bot subsystem for processing
        self.process_message(req)
Exemplo n.º 4
0
    def on_message(self, sender, channel, flags, message, private):
        req = Request(message=message)
        req.nick = sender.nickname
        req.private = private
        req.silc_sender = sender
        if private:
            req.addressed = True
            req.sendto = sender
            req.channel = u'privmsg'
        else:
            req.addressed = False
            req.sendto = channel
            req.channel = channel.channel_name

        req.message = decode(req.message)
        req.message = self.colorlib.strip_color(req.message)
        self.check_addressing(req)

        if req.message.startswith(u'^'):
            req.message = req.message[1:]
            req.colorize = True
        else:
            req.colorize = False

        self.process_message(req)