Exemplo n.º 1
0
            message = ' '.join(msg[3:])
            print "The message was: " + message
        #if msg[1] == 'PRIVMSG' and ircbpcommon.ischanmember(msg[2]):
        if msg[1] == 'PRIVMSG' and msg[2][0] == "#":
            # Doing this for HOSTMASK auth method which is now in use
            HOSTMASK = string.lstrip(msg[0], ':')
            # Some functions still need nick_name so lets keep it!
            nick_name = string.lstrip(msg[0][:string.find(msg[0],"!")], ':')
            CHANNEL = msg[2]
            if len(msg) > 3:
                print "We have a channel message! - W00T!!!"
    
                # Say Command
    
                if string.upper(string.lstrip(msg[3], ':')) == string.upper('!say'):
                    if ircbpcommon.privcheck(HOSTMASK, "U"):
                        print "We need to say something :P"
                        message = ' '.join(msg[4:])
                        ircbpcommon.irccommand("PRIVMSG " + CHANNEL + " :" + message)
                    else:
                        # They don't have privledges!
                        ircbpcommon.irccommand("PRIVMSG " + CHANNEL + " :No privledges for this command!")

                # Topic Command

                if string.upper(string.lstrip(msg[3], ':')) == string.upper('!topic'):
                    if ircbpcommon.privcheck(HOSTMASK, "O"):
                        if len(msg) > 4:
                            print "Changing Topic"
                            message = ' '.join(msg[4:])
                            print "The new topic will be: " + message
Exemplo n.º 2
0
            nick_name = string.lstrip(msg[0][: string.find(msg[0], "!")], ":")
            CHANNEL = msg[2]
            if len(msg) > 3:
                print "We have a channel message! - W00T!!!"

                # Say Command

                if string.upper(string.lstrip(msg[3], ":")) == string.upper("!say"):
                    print "We need to say something :P"
                    message = " ".join(msg[4:])
                    ircbpcommon.irccommand("PRIVMSG " + CHANNEL + " :" + message)

                # Topic Command

                if string.upper(string.lstrip(msg[3], ":")) == string.upper("!topic"):
                    if ircbpcommon.privcheck(HOSTMASK):
                        if len(msg) > 4:
                            print "Changing Topic"
                            message = " ".join(msg[4:])
                            print "The new topic will be: " + message
                            ircbpcommon.irccommand("TOPIC " + CHANNEL + " :" + message)
                        else:
                            print "This is work in process"
                    else:
                        # They don't have privledges!
                        ircbpcommon.irccommand("PRIVMSG " + CHANNEL + " :No privledges for this command!")

                # Kick Command

                if string.upper(string.lstrip(msg[3], ":")) == string.upper("!kick"):
                    if ircbpcommon.privcheck(HOSTMASK) == 1: