Пример #1
0
def exempt(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:
            target = arg.split()[0][1:]
            scut = arg.split()[0][0]

            if wmatch(target, "*!*@*"):
                if scut == "+":
                    entry = False

                    for data in _chandb.execute(
                            "select exempt from exempts where channel='%s' and exempt='%s'"
                            % (chan, target)):
                        entry = True

                    if entry is False:
                        _chandb.execute(
                            "insert into exempts values ('%s','%s')" %
                            (chan, target))
                        put("NOTICE %s :[%s] %s has been added to the exemptlist"
                            % (nick, chan, target))
                        whochan(chan)
                    else:
                        put("NOTICE %s :[%s] %s is already on the exemptlist" %
                            (nick, chan, target))
                elif scut == "-":
                    entry = False

                    for data in _chandb.execute(
                            "select exempt from exempts where channel='%s' and exempt='%s'"
                            % (chan, target)):
                        entry = True

                    if entry is True:
                        _chandb.execute(
                            "delete from exempts where channel='%s' and exempt='%s'"
                            % (chan, target))
                        put("NOTICE %s :[%s] %s has been removed from the exemptlist"
                            % (nick, chan, target))
                        put("MODE %s -b %s" % (chan, target))
                    else:
                        put("NOTICE %s :[%s] %s is not on the exemptlist" %
                            (nick, chan, target))
                else:
                    irc_send(nick, "$exempt +/-*!*example@*.example.com")
            else:
                irc_send(nick, "$exempt +/-*!*example@*.example.com")
        else:
            for data in _chandb.execute(
                    "select exempt from exempts where channel='%s'" % chan):
                irc_send(nick, "[%s] %s" % (chan, str(data[0])))
Пример #2
0
def exempt(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:
			target = arg.split()[0][1:]
			scut = arg.split()[0][0]

			if wmatch(target, "*!*@*"):
				if scut == "+":
					entry = False

					for data in _chandb.execute("select exempt from exempts where channel='%s' and exempt='%s'" % (chan,target)):
						entry = True

					if entry is False:
						_chandb.execute("insert into exempts values ('%s','%s')" % (chan,target))
						put("NOTICE %s :[%s] %s has been added to the exemptlist" % (nick,chan,target))
						whochan(chan)
					else:
						put("NOTICE %s :[%s] %s is already on the exemptlist" % (nick,chan,target))
				elif scut == "-":
					entry = False

					for data in _chandb.execute("select exempt from exempts where channel='%s' and exempt='%s'" % (chan,target)):
						entry = True

					if entry is True:
						_chandb.execute("delete from exempts where channel='%s' and exempt='%s'" % (chan,target))
						put("NOTICE %s :[%s] %s has been removed from the exemptlist" % (nick,chan,target))
						put("MODE %s -b %s" % (chan,target))
					else:
						put("NOTICE %s :[%s] %s is not on the exemptlist" % (nick,chan,target))
				else:
					irc_send(nick,"$exempt +/-*!*example@*.example.com")
			else:
				irc_send(nick,"$exempt +/-*!*example@*.example.com")
		else:
			for data in _chandb.execute("select exempt from exempts where channel='%s'" % chan):
				irc_send(nick,"[%s] %s" % (chan,str(data[0])))
Пример #3
0
def on_366(text):
    whochan(text.split()[3])
Пример #4
0
def on_366(text):
	whochan(text.split()[3])