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 on_nickchange(nick,uhost,newnick): for data in _cache.execute("select name from botnick"): if nick == str(data[0]): _cache.execute("update botnick set name='%s'" % newnick) if nick.lower() == _botnick.lower(): _cache.execute("update botnick set name='%s'" % _botnick) put("NICK %s" % _botnick) _userdb.execute("delete from auth where nick='%s'" % nick) whois(newnick)
def on_nickchange(nick, uhost, newnick): for data in _cache.execute("select name from botnick"): if nick == str(data[0]): _cache.execute("update botnick set name='%s'" % newnick) if nick.lower() == _botnick.lower(): _cache.execute("update botnick set name='%s'" % _botnick) put("NICK %s" % _botnick) _userdb.execute("delete from auth where nick='%s'" % nick) whois(newnick)
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 check_user(text): if not c.get("SERVER", "address").lower().endswith(".quakenet.org"): whois(text.split()[7])