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
19 lines
435 B
Python
import logging
|
|
import random
|
|
|
|
from bot.commands import send_tweet
|
|
from bot.winston import Winston
|
|
|
|
logger = logging.getLogger()
|
|
logger.setLevel(logging.INFO)
|
|
|
|
|
|
def event_handler(event, context):
|
|
"""Sends random tweet from list of potential tweets"""
|
|
winston = Winston()
|
|
|
|
random_tweet = random.choice(winston.potential_tweets)
|
|
send_tweet(winston.bot, random_tweet)
|
|
|
|
logger.info(f"Random Tweet Sent: {random_tweet}")
|