self.conn.send("NICK %s" % (self.permnick))
def parse(self, line):
- if self.parent.cfg.getboolean('debug', 'io'):
- self.log('I', line)
pieces = line.split()
if pieces[0][0] == ":":
main.fd(fileno).close()
else:
for line in data:
+ if cfg.getboolean('debug', 'io'):
+ main.log(str(main.fd(fileno)), 'I', line)
try:
main.fd(fileno).parse(line)
except:
return lines
def parse(self, line):
- peer = self.sock.getpeername()
bot = lib.parent.randbot()
maxlen = bot.maxmsglen() - len("PRIVMSG :") - len(self.chan)
- lib.parent.log(str(self), 'I', line)
while len(line) > maxlen:
cutat = line.rfind(' ', 0, maxlen)
if cutat == -1:
bot.msg(self.chan, line)
def send(self, line):
+ if lib.parent.parent.cfg.getboolean('debug', 'io'):
+ lib.parent.log(str(self), 'O', line)
self.sock.sendall(line.encode('utf-8', 'backslashreplace')+b"\r\n")
def _getsockerr(self):