diff --git a/bot/handler.py b/bot/handler.py index 0e968fd..429b904 100644 --- a/bot/handler.py +++ b/bot/handler.py @@ -1,5 +1,4 @@ import logging -import random from bot.winston import Winston @@ -22,4 +21,4 @@ def event_handler(event, context): for key, values in event.items(): Actions[key](values) - winston.send_tweet(random.choice(winston.potential_tweets)) + winston.send_random_tweet() diff --git a/bot/winston.py b/bot/winston.py index 841eae2..876e459 100644 --- a/bot/winston.py +++ b/bot/winston.py @@ -1,3 +1,5 @@ +import random + import filetype as filetype from twython import Twython @@ -16,7 +18,7 @@ class Winston: "I didn't pay my taxes!", "I'm wanted in over 60 countries! I'm still on the run :D", "Overwatch", - + ] def send_tweet(self, tweet_text): @@ -24,6 +26,11 @@ class Winston: self.bot.update_status(status=tweet_text) + def send_random_tweet(self): + """Tweet something random from potential tweets""" + + self.bot.update_status(status=random.choice(self.potential_tweets)) + def tweet_with_media(self, text_and_media): """Tweet with media + optional text"""