def receive(line, bot_socket): text = mfunctions.user_priv(line) if(text): if(text[1][:3] == "!op" and len(text[1]) > 4 and text[1][4:] == mconfig.OP_PASSWD): mfunctions.send("MODE "+ mconfig.CHANNEL+' +o ' +text[0]+"\r\n", bot_socket) if( text[1][:6] == "!topic" and len(text[1]) > 4 and text[1][7:len(mconfig.OP_PASSWD)+7] == mconfig.OP_PASSWD ): mline = "TOPIC "+ mconfig.CHANNEL+' :' +text[1][8+len(mconfig.OP_PASSWD):]+"\r\n" mfunctions.send(mline, bot_socket)
def receive(line, bot_socket): lines = line.split(' ') text = mfunctions.user_text(line) if(lines[0] == "PING"): mfunctions.send("PONG %s\r\n" % lines[1],bot_socket) print('PONG '+lines[1]) if(lines[0] == "KICK"): mfunctions.send("JOIN "+mconfig.CHANNEL+"\r\n",bot_socket) if(text): if(text[1] == "!uptime"): mfunctions.say(os.popen('uptime').read(),bot_socket) elif(text[1] == "!reg"): mfunctions.send("PRIVMSG NickServ : IDENTIFY "+mconfig.PASSWORD+"\r\n",bot_socket)