def listen(): while 1: ircmsg = ircsock.recv(2048) ircmsg = ircmsg.strip('\n\r') if ircmsg.find("PING :") != -1: ping() formatted = formatter.format_message(ircmsg) if "" == formatted: continue print formatted split = formatted.split("\t") time = split[0] user = split[1] messageText = split[2] if ircmsg.find(":!tilde") != -1: tilde(options.channel, user, time) if ircmsg.find("PING :") != -1: ping() sys.stdout.flush()
def listen(): while 1: ircmsg = ircsock.recv(2048) ircmsg = ircmsg.strip('\n\r') if ircmsg.find("PING :") != -1: ping() formatted = formatter.format_message(ircmsg) if "" == formatted: continue # print formatted split = formatted.split("\t") time = split[0] user = split[1] command = split[2] channel = split[3] messageText = split[4] if(command == "TOPIC" and user != options.nick): count_topic(channel,user, time, messageText) if ircmsg.find(":!topic") != -1: get_topic(channel, user, time) if ircmsg.find(":!settopic") != -1: set_topic(channel, user, time, messageText[10:]) if ircmsg.find(":!tscores") != -1: topic_scores(channel) elif ircmsg.find(":!tscores") != -1: topic_score(channel) if ircmsg.find(":!randomtopic") != -1: random_topic(channel, user, time, True) if ircmsg.find(":!suggesttopic") != -1: random_topic(channel,user,time, False) if ircmsg.find(":!thistory") != -1: topic_history(channel, user, messageText) if ircmsg.find(":!rollcall") != -1: rollcall(channel) if ircmsg.find("PING :") != -1: ping() sys.stdout.flush()
def listen(): while 1: ircmsg = ircsock.recv(2048) ircmsg = ircmsg.strip('\n\r') if ircmsg.find("PING :") != -1: ping() formatted = formatter.format_message(ircmsg) if "" == formatted: continue # print formatted split = formatted.split("\t") time = split[0] user = split[1] command = split[2] channel = split[3] messageText = split[4] if ircmsg.find("#banter") != -1 or ircmsg.find("#bantz") != -1: score_banter(channel, user, messageText) if ircmsg.find(":!newbanter") != -1: get_new_banter(channel, user) if ircmsg.find(":!rhymes") != -1: get_rhymes(channel, user, messageText) if ircmsg.find(":!define") != -1: define_word(channel, user, messageText) if ircmsg.find(":!rainbow") != -1: make_rainbow(channel, user, messageText) if ircmsg.find(":!rollcall") != -1: rollcall(channel) if ircmsg.find("PING :") != -1: ping() sys.stdout.flush()
def listen(): while 1: ircmsg = ircsock.recv(2048) ircmsg = ircmsg.strip('\n\r') if ircmsg.find("PING :") != -1: ping() formatted = formatter.format_message(ircmsg) if "" == formatted: continue # print formatted split = formatted.split("\t") iTime = split[0] user = split[1] command = split[2] channel = split[3] messageText = split[4] if ircmsg.find(":!tildescore") != -1: show_tildescore(channel, user) elif ircmsg.find(":!tilde") != -1 and not challenges.has_key(user): challenge(channel, user, iTime) elif challenges.has_key(user): challenge_response(channel, user, iTime, messageText) #give_tilde(channel, user, iTime) if ircmsg.find(":!jackpot") != -1: show_jackpot(channel) if ircmsg.find(":!rollcall") != -1: rollcall(channel) if ircmsg.find("PING :") != -1: ping() sys.stdout.flush() time.sleep(1)
def listen(): while 1: ircmsg = ircsock.recv(2048) ircmsg = ircmsg.strip('\n\r') if ircmsg.find("PING :") != -1: ping() formatted = formatter.format_message(ircmsg) if "" == formatted: continue print formatted split = formatted.split("\t") time = split[0] user = split[1] messageText = split[2] if ircmsg.find(":!quote") != -1: random_quote(options.channel) if ircmsg.find(":!mentions") != -1: say_mentions(user, ircmsg) if ircmsg.find(":!chatty") != -1: say_chatty(options.channel) if ircmsg.find(":!haiku") != -1: haiku(options.channel) if ircmsg.find("PING :") != -1: ping() sys.stdout.flush()
def listen(): while 1: time.sleep(1) ircmsg = ircsock.recv(2048) ircmsg = ircmsg.strip('\n\r') if ircmsg.find("PING :") != -1: ping() formatted = formatter.format_message(ircmsg) if "" == formatted: continue split = formatted.split("\t") timestamp = split[0] user = split[1] messageText = split[2] if user in blacklist: continue print formatted if ircmsg.find(":!quote") != -1: random_quote(options.channel) if ircmsg.find(":!q-apropos") != -1: random_quote_apropos(options.channel, formatted) if ircmsg.find(":!q-from") != -1: random_quote_from(options.channel, formatted) if ircmsg.find(":!q-add") != -1: random_quote_add(options.channel, formatted) if ircmsg.find(":!q-screenplay") != -1: random_quote_screenplay(options.channel, formatted) if ircmsg.find(":!ircpopularity") != -1: ircpopularity(options.channel, formatted) if ircmsg.find(":!famouslastwords") != -1: famouslastwords(options.channel, formatted) if ircmsg.find(":!famousfirstwords") != -1: famousfirstwords(options.channel, formatted) if ircmsg.find(":!ccstat") != -1: ccstat(options.channel, formatted) if ircmsg.find(":!lasttimeon") != -1: lasttimeon(options.channel, formatted) if ircmsg.find(":!saidwhat") != -1: saidwhat(options.channel, formatted) if ircmsg.find(":!pourouta40") != -1: rememberthem(options.channel, formatted) if ircmsg.find(":!pondareplay") != -1: pondareplay(options.channel, formatted) if ircmsg.find(":!chatabout") != -1: chatabout(options.channel, formatted) if ircmsg.find(":!mentions") != -1: say_mentions(user, ircmsg) if ircmsg.find(":!mention-of") != -1: say_mentionsof(user, ircmsg, formatted) if ircmsg.find(":!chatty") != -1: say_chatty(options.channel) if ircmsg.find(":!rchatty") != -1: say_recentchatty(options.channel, formatted) if ircmsg.find(":!help") != -1: say_help(options.channel, formatted) if ircmsg.find(":!tday") != -1: say_townage(options.channel) if ircmsg.find(":!countdown") != -1: say_countdown(options.channel, formatted) if ircmsg.find(":!cursey") != -1: say_cursey(options.channel) if ircmsg.find(":!catchup") != -1: say_catchup(options.channel, user, ircmsg, formatted) if ircmsg.find(":!rollcall") != -1: say_rollcall(options.channel) if ircmsg.find(":!haiku") != -1: haiku(options.channel) if ircmsg.find(":!tweet") != -1: do_tweet(options.channel, formatted) if ircmsg.find(":!random") != -1: random_thing(options.channel, formatted) if ircmsg.find("PING :") != -1: ping() sys.stdout.flush()