def create_room(room_name, set_topic=None): found_room = None for room in Room.list(): if room.name.lower() == room_name.lower(): found_room = room.room_id if found_room: if set_topic: print "updating room topic to %r" % set_topic Room.topic(room_id=found_room, topic=set_topic, **{"from": settings.BOT_NAME}) return found_room else: print "creating new room %s" % room_name room = Room.create( name=room_name, owner_user_id=state["bot_user_id"], topic=set_topic or "(go team!)", ) return room.room_id
def create_room(room_name, set_topic=None): found_room = None for room in Room.list(): if room.name.lower() == room_name.lower(): found_room = room.room_id if found_room: if set_topic: print "updating room topic to %r" % set_topic Room.topic( room_id=found_room, topic=set_topic, **{"from": settings.BOT_NAME} ) return found_room else: print "creating new room %s" % room_name room = Room.create( name=room_name, owner_user_id=state["bot_user_id"], topic=set_topic or "(go team!)", ) return room.room_id
exit() if hipchat_room_names == None: hipchat_room_names = [hipchat_room_name] my_username = "******" try: raw_hipchat_log=open('lucille.log') hipchat_log = json.load(raw_hipchat_log) raw_hipchat_log.close() except Exception: hipchat_log = {}; hipchat_rooms = [] for r in Room.list(): if r.name in hipchat_room_names: hipchat_rooms.append(r) if len(hipchat_rooms) == 0: print "no room found for digg" exit() GIPHY_REGEX = re.compile("\/giphy (.+)") EIGHTBALL_COMMAND_TERM = "8ball" EIGHTBALL_POSITIVE_RESPONSES = set(['It is decidedly so', 'Without a doubt', 'Yes definitely', 'It is certain', 'Most likely', 'You may rely on it', 'Yes', 'Outlook good', 'As I see it yes', 'Signs point to yes']) EIGHTBALL_NEGATIVE_RESPONSES = set(['Cannot predict now', 'Reply hazy try again', 'Ask again later', 'Better not tell you now', 'Concentrate and ask again']) EIGHTBALL_NEUTRAL_RESPONSES = set(['My reply is no', 'My sources say no', "Don't count on it", 'Very doubtful', 'Outlook not so good']) EIGHTBALL_RESPONSE_TO_KEYWORDS = {
exit() if hipchat_room_names == None: hipchat_room_names = [hipchat_room_name] my_username = "******" try: raw_hipchat_log = open('lucille.log') hipchat_log = json.load(raw_hipchat_log) raw_hipchat_log.close() except Exception: hipchat_log = {} hipchat_rooms = [] for r in Room.list(): if r.name in hipchat_room_names: hipchat_rooms.append(r) if len(hipchat_rooms) == 0: print "no room found for digg" exit() GIPHY_REGEX = re.compile("\/giphy (.+)") EIGHTBALL_COMMAND_TERM = "8ball" EIGHTBALL_POSITIVE_RESPONSES = set([ 'It is decidedly so', 'Without a doubt', 'Yes definitely', 'It is certain', 'Most likely', 'You may rely on it', 'Yes', 'Outlook good', 'As I see it yes', 'Signs point to yes' ])