Exemple #1
0
def process_message(data):
    print "new message...", data
    if not should_act_on_message(data):
        return
    if REGISTER.match(data['text']):
        username = get_username_from_user_id(data["user"])
        outputs.append([data['channel'], register_user(data["user"], username, data['text'])])
Exemple #2
0
def process_message(data):
    print "new message...", data
    if not should_act_on_message(data):
        return
    text_data = data['text'].replace("warbot", "").replace("warby", "")
    if SHOW_ME_THE_PIPELINE.match(text_data):
        outputs.append([data['channel'], get_pipeline(data)])
def process_message(data):
    print "new message...", data
    if not should_act_on_message(data):
        return
    text_data = data['text'].replace("warbot", "").replace("warby", "")
    if WATCH_MY_WAR.match(text_data):
        username = get_username_from_user_id(data["user"])
        outputs.append([data['channel'], watch_my_war(data["user"], username, text_data)])
def process_message(data):
    print "new message...", data
    if not should_act_on_message(data):
        return
    if UNBEIGE.match(data['text']):
        username = get_username_from_user_id(data["user"])
        outputs.append([data['channel'], un_notify_end_of_beige(data["user"], username, data['text'])])
    elif END_OF_BEIGE.match(data['text']):
        username = get_username_from_user_id(data["user"])
        outputs.append([data['channel'], notify_end_of_beige(data["user"], username, data['text'])])
Exemple #5
0
def process_message(data):
    print "new message...", data
    if not should_act_on_message(data):
        return
    if HELP.match(data['text']):
        outputs.append([data['channel'], helpstring])
Exemple #6
0
def process_message(data):
    print "new message...", data
    if not should_act_on_message(data):
        return
    if WHO_IS.match(data['text']):
        outputs.append([data['channel'], who_is_nation(data['text'])])