Example #1
0
    def chat(self, message, target=None, error=False):

        if self.context in self.channels \
            and not target \
            and 'speak' not in self.channels[self.context]['mods']:
                return

        if self.bequiet:
            return

        if not message:
            return

        if target:
            whom = target
        elif self.context in self.channels:
            whom = self.context
        else:
            try:
                user = Id(self.lastsender)
                whom = user.nick
            except:
                whom = self.secrets.primary_channel

        if randint(1, 170) == 13:
            message = zalgo(message)

        # test later
        # message = filter(lambda x: x in string.printable, message)

        try:
            message = message.encode('utf-8')
            self.logroom('___%s: %s\n' % (self.personality.nick, str(message)))
            m = str(message)
            if randint(1, 170) == 23:
                i = m.split()
                pos = randint(0, len(i))
                i.insert(pos, 'fnord')
                m = ' '.join(i)

            if error:
                m += ' %s' % str(error)

            self.thalamus.send('PRIVMSG %s :%s' % (whom, m))
        except Exception as e:
            try:
                self.thalamus.send('PRIVMSG %s :ERROR: ' % (whom, str(e)))
            except:
                pass
Example #2
0
    def chat(self, message, target=False, error=False):

        if self.context in self.channels \
            and not target \
            and 'speak' not in self.channels[self.context]['mods']:
            return

        if self.bequiet:
            return

        if not message:
            return

        if target:
            whom = target
        elif self.context in self.channels:
            whom = self.context
        else:
            user = Id(self.lastsender)
            whom = user.nick

        if randint(1, 170) == 13:
            message = zalgo(message)

        # test later
        # message = filter(lambda x: x in string.printable, message)

        try:
            message = message.encode('utf-8')
            self.logroom('___%s: %s\n' % (self.personality.nick, str(message)))
            m = str(message)
            if randint(1, 170) == 23:
                i = m.split()
                pos = randint(0, len(i))
                i.insert(pos, 'fnord')
                m = ' '.join(i)

            if error:
                m += ' %s' % str(error)

            self.thalamus.send('PRIVMSG %s :%s' % (whom, m))
        except Exception as e:
            try:
                self.thalamus.send('PRIVMSG %s :ERROR: ' % (whom, str(e)))
            except:
                pass
Example #3
0
 def zal(self):
     return zalgo(' '.join(self.values))
Example #4
0
 def zal(self):
     return zalgo(' '.join(self.values))