def nick_identify(nick, uhost, target, arg): if nick == "NickServ": if arg.lower().find("wenn du ihn nicht innerhalb einer minute identifizierst") != -1: ns_pw = c.get("SERVICES", "nickserv") putf("PRIVMSG NickServ :IDENTIFY %s" % ns_pw) elif arg.lower().find("nickname is registered") != -1: ns_pw = c.get("SERVICES", "nickserv") putf("PRIVMSG NickServ :IDENTIFY %s" % ns_pw)
def nick_identify(nick, uhost, target, arg): if nick == "NickServ": if arg.lower().find( "wenn du ihn nicht innerhalb einer minute identifizierst" ) != -1: ns_pw = c.get("SERVICES", "nickserv") putf("PRIVMSG NickServ :IDENTIFY %s" % ns_pw) elif arg.lower().find("nickname is registered") != -1: ns_pw = c.get("SERVICES", "nickserv") putf("PRIVMSG NickServ :IDENTIFY %s" % ns_pw)
def on_join_chan(nick, uhost, chan): whois(nick) hostmask = nick + "!" + uhost auth = getauth(nick) flag = getflag(chan, auth) hostflag = gethostflag(chan, hostmask) if flag == "n" or flag == "o" or hostflag == "o": putf("MODE %s +o %s" % (chan, nick)) elif flag == "v" or hostflag == "v": putf("MODE %s +v %s" % (chan, nick))
def deop(nick, host, chan, arg): auth = getauth(nick) flag = getflag(chan, auth) hostmask = nick + "!" + host hostflag = gethostflag(chan, hostmask) if flag == "n" or flag == "o" or hostflag == "o": if len(arg.split()) != 0: mode = "o" * len(arg.split()) putf("MODE %s -%s %s" % (chan, mode, arg)) else: putf("MODE %s -o %s" % (chan, nick))
def voice(nick,host,chan,arg): auth = getauth(nick) flag = getflag(chan,auth) hostmask = nick+"!"+host hostflag = gethostflag(chan,hostmask) if flag == "n" or flag == "o" or hostflag == "o": if len(arg.split()) != 0: mode = "v"*len(arg.split()) putf("MODE %s +%s %s" % (chan,mode,arg)) else: putf("MODE %s +v %s" % (chan,nick))
def on_join_chan(nick,uhost,chan): whois(nick) hostmask = nick + "!" + uhost auth = getauth(nick) flag = getflag(chan,auth) hostflag = gethostflag(chan,hostmask) if flag == "n" or flag == "o" or hostflag == "o": putf("MODE %s +o %s" % (chan,nick)) elif flag == "v" or hostflag == "v": putf("MODE %s +v %s" % (chan,nick))
def channel_auth(nick,host,chan,arg): whois(nick) put("NOTICE %s :[%s] Trying to auth ..." % (nick,chan)) auth = getauth(nick) hostmask = nick+"!"+host put("NOTICE %s :[%s] Getting flag for %s (%s)..." % (nick,chan,auth,hostmask)) flag = getflag(chan,auth) hostflag = gethostflag(chan,hostmask) put("NOTICE %s :[%s] Flag: %s, Hostflag: %s" % (nick,chan,flag,hostflag)) if flag == "n" or flag == "o" or hostflag == "o": putf("MODE %s +o %s" % (chan,nick)) elif flag == "v" or hostflag == "v": putf("MODE %s +v %s" % (chan,nick))
def channel_auth(nick, host, chan, arg): whois(nick) put("NOTICE %s :[%s] Trying to auth ..." % (nick, chan)) auth = getauth(nick) hostmask = nick + "!" + host put("NOTICE %s :[%s] Getting flag for %s (%s)..." % (nick, chan, auth, hostmask)) flag = getflag(chan, auth) hostflag = gethostflag(chan, hostmask) put("NOTICE %s :[%s] Flag: %s, Hostflag: %s" % (nick, chan, flag, hostflag)) if flag == "n" or flag == "o" or hostflag == "o": putf("MODE %s +o %s" % (chan, nick)) elif flag == "v" or hostflag == "v": putf("MODE %s +v %s" % (chan, nick))
def channel_msg_auth(nick,host,arg): if len(arg) == 0: irc_send(nick, "no channel specified") elif arg.startswith("#"): whois(nick) chan = arg.split()[0] put("NOTICE %s :[%s] Trying to auth ..." % (nick,chan)) auth = getauth(nick) hostmask = nick+"!"+host put("NOTICE %s :[%s] Getting flag for %s (%s)..." % (nick,chan,auth,hostmask)) flag = getflag(chan,auth) hostflag = gethostflag(chan,hostmask) put("NOTICE %s :[%s] Flag: %s, Hostflag: %s" % (nick,chan,flag,hostflag)) if flag == "n" or flag == "o" or hostflag == "o": putf("MODE %s +o %s" % (chan,nick)) elif flag == "v" or hostflag == "v": putf("MODE %s +v %s" % (chan,nick)) else: irc_send(nick, "invalid channel")
def channel_msg_auth(nick, host, arg): if len(arg) == 0: irc_send(nick, "no channel specified") elif arg.startswith("#"): whois(nick) chan = arg.split()[0] put("NOTICE %s :[%s] Trying to auth ..." % (nick, chan)) auth = getauth(nick) hostmask = nick + "!" + host put("NOTICE %s :[%s] Getting flag for %s (%s)..." % (nick, chan, auth, hostmask)) flag = getflag(chan, auth) hostflag = gethostflag(chan, hostmask) put("NOTICE %s :[%s] Flag: %s, Hostflag: %s" % (nick, chan, flag, hostflag)) if flag == "n" or flag == "o" or hostflag == "o": putf("MODE %s +o %s" % (chan, nick)) elif flag == "v" or hostflag == "v": putf("MODE %s +v %s" % (chan, nick)) else: irc_send(nick, "invalid channel")
def quakenet_auth(text): if c.get("SERVICES", "quakenet") != "" and len( c.get("SERVICES", "quakenet").split()) == 2: putf("AUTH %s" % c.get("SERVICES", "quakenet"))
def channel_join(text): putf("JOIN %s" % c.get("BOT", "channels")) for data in _chandb.execute("select channel from list"): put("JOIN %s" % data[0])
def irc_botmode(text): for data in _cache.execute("select name from botnick"): putf("MODE %s +B" % str(data[0]))
def quakenet_mode_x(nick, host, target, arg): react = "are now logged in as " + c.get("SERVICES", "quakenet").split()[0] + "." if arg == react: putf("MODE %s +x" % target)
def quakenet_mode_x(nick,host,target,arg): react = "are now logged in as "+c.get("SERVICES","quakenet").split()[0]+"." if arg == react: putf("MODE %s +x" % target)
def quakenet_auth(text): if c.get("SERVICES", "quakenet") != "" and len(c.get("SERVICES", "quakenet").split()) == 2: putf("AUTH %s" % c.get("SERVICES", "quakenet"))
def nick_in_use(text): for data in _cache.execute("select name from botnick"): putf("NICK %s_" % str(data[0])) _cache.execute("update botnick set name='%s_'" % str(data[0]))