aboutsummaryrefslogtreecommitdiffstats
path: root/bot.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot.py')
-rw-r--r--bot.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot.py b/bot.py
index 7e3c6f7..3c8f6e0 100644
--- a/bot.py
+++ b/bot.py
@@ -7,7 +7,10 @@ import get_images
twitter = Twython(*get_images.CONFIG["twitterapi"].values())
def post():
- impath, source, text = get_images.main()
+ images = get_images.main()
+ while images is None:
+ images = get_images.main()
+ impath, source, text = images
with open(impath, "rb") as img:
response = twitter.upload_media(media = img)
message = f"{text} ({source})"