def catfacts(message): """ Sends catfacts! """ if 'cat' in message['text'].lower(): catfact = requests.get(CATFACTS_URL).json() utils.send_message(catfact['fact'])
def vandy(message): """ Vandy things """ if 'go dores' in message['text'].lower(): utils.send_message('ANCHOR DOWN \u2693\ufe0f') if 'anchor down' in message['text'].lower(): utils.send_message('GO DORES')
def remind(force): """ Remind everyone to come to saucer """ today = datetime.datetime.now() if today.weekday() == 0 or force: send_message('Saucer at 7PM. Like if.') else: click.echo("Not sending message, it's not Monday!")
def new_arrivals(message): """ Gets all the new arrivals """ matches = ('new arrivals', 'new beers') for match in matches: if match in message['text'].lower(): utils.send_message(utils.get_new_arrivals()) break
def pizza(message): """ complain about pizza """ matches = ('thin crust', 'deep dish') for match in matches: if match in message['text'].lower(): utils.send_message( 'That is a false binary and you know it, asshole') break
def mars(message): """ Sends a message about mars if a user posts an image """ for attachment in message['attachments']: if attachment['type'] == 'image': pre_message = "That's a cool picture of Mars, " attachments = [{ 'type': 'mentions', 'user_ids': [message['user_id']], 'loci': [(len(pre_message), len(message['name']) + 1)], }] full_message = '{}@{}'.format(pre_message, message['name']) utils.send_message(full_message, attachments=attachments) break
def system_messages(message): """ Process system messages """ if not message['system']: return remove_match = REMOVE_RE.match(message['text']) add_match = ADD_RE.match(message['text']) change_name_match = CHANGE_RE.match(message['text']) if remove_match: utils.send_message('{emoji}', attachments=[utils.get_emoji_attachment([[4, 36]])]) if add_match: utils.send_message('{emoji}', attachments=[utils.get_emoji_attachment([[2, 44]])]) if change_name_match: utils.send_message('{emoji}', attachments=[utils.get_emoji_attachment([[1, 81]])])
def you_suck_too_coach(message): """ Sends 'YOU SUCK TOO COACH' """ if 'you suck' in message['text'].lower(): utils.send_message('YOU SUCK TOO COACH')
def dont_at_me(message): if '@saucerbot' in message['text']: utils.send_message("don't @ me \ud83d\ude44") elif '@ saucerbot' in message['text'].lower( ) or '@saucerbot' in message['text'].lower(): utils.send_message("you think you're sneaky don't you")
def lit(message): """ battle with the lit bot """ if 'lit fam' in message['text'].lower(): utils.send_message("You're not lit, I'm lit")