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.

21 lines
583 B
Python

from bot.winston import Winston
def event_handler(event, context):
"""Sends random tweet from list of potential tweets"""
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():
if key in Actions:
Actions[key](values)
winston.send_random_tweet()