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.

19 lines
435 B
Python

4 years ago
import logging
import random
from bot.commands import send_tweet
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()
random_tweet = random.choice(winston.potential_tweets)
send_tweet(winston.bot, random_tweet)
logger.info(f"Random Tweet Sent: {random_tweet}")