From 244de5578b3b73990647a92261fd73f3ff7999c2 Mon Sep 17 00:00:00 2001 From: Lasse Studion Date: Sun, 18 Dec 2022 17:44:52 +0100 Subject: [PATCH] Reply to private --- answering_machine.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/answering_machine.py b/answering_machine.py index 59c0327..2c1f715 100644 --- a/answering_machine.py +++ b/answering_machine.py @@ -13,17 +13,19 @@ def main(tweet): t_username = tweet["t_username"] followings = collect_followers.get_followings(t_username) if followings == 'private': - twitter_api.reply_to_private(tweet["tweet_id"], t_username) - followings = collect_followers.update_db(followings) + twitter.reply_to_private(tweet["tweet_id"], t_username) + + else: + followings = collect_followers.update_db(followings) - filename = collect_followers.export_followings(followings, t_username) + filename = collect_followers.export_followings(followings, t_username) - # Share to dropbox - dropbox = dropbox_api.API() - shared_file_url = dropbox.upload_file(filename) + # Share to dropbox + dropbox = dropbox_api.API() + shared_file_url = dropbox.upload_file(filename) - # Reply to tweet with url. - twitter.reply_with_url(tweet["tweet_id"], shared_file_url, t_username) + # Reply to tweet with url. + twitter.reply_with_url(tweet["tweet_id"], shared_file_url, t_username) sql = f'DELETE FROM queue WHERE t_username == "{t_username}"' db.commit(sql)