You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
628 B
Python

4 years ago
import logging
4 years ago
from bot.winston import Winston
4 years ago
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def event_handler(event, context):
"""Sends random tweet from list of potential tweets"""
4 years ago
winston = Winston()
Actions = {
"tweet": lambda text: winston.send_tweet(text),
"tweet_media": lambda text_and_media: winston.tweet_with_media(text_and_media),
"like": lambda tweet_id: winston.like_tweet(tweet_id),
"follow": lambda username: winston.follow_someone(username)
}
for key, values in event.items():
Actions[key](values)
4 years ago
winston.send_random_tweet()