def crazy_phrases(bot_input, bot_output): phrase = random.choice(phrases) # storage.set_hash_value(list_name, bot_input.nick, phrase) bot_output.say("you're in {0}".format(bot_input.nick)) user_phrases[bot_input.nick] = textutils.sanitize_message(phrase) user_points[bot_input.nick] = storage.get_hash_value(list_name, bot_input.nick) or 0 user = bot_output.get_user_by_name(bot_input.nick) bot_output.private_message(str(user["id"]), "Your phrase is: %s" % phrase)
def add_point(nick, points): current_score = int(storage.get_hash_value(list_name, nick) or 0) if points > 0: points = points * current_trivia['multiplier'] user_points[nick] = current_score + points storage.set_hash_value(list_name, nick, user_points[nick])