-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (40 loc) · 1.5 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import sys
from manage import manage_accounts
from poster import post_to_single_account,post_5_strategy
from utils.print_color_utils import print_header,print_error,print_success,print_warning,print_info,print_highlight,print_debug,get_user_input
from reply import reply_main
from replybot.save_tweet_list import save_tweets_from_list
def main():
"""Main function to manage everything."""
actions = {
1: manage_accounts,
2: post_to_single_account,
3: post_5_strategy,
4: reply_main,
# 6: save_tweets_from_list,
7: sys.exit,
}
while True:
print_header("Post Reels")
print("1. Manage Accounts")
print("2. Post to single account")
print("3. Post 5 times/day to a single account")
print("4. Reply to the latest tweets in a curated list.")
# print("5. placeholder")
# print("5. Retrive the latest tweets from autoreply list")
print("7. Exit")
try:
action = int(get_user_input("Choose an action: "))
if action in actions:
actions[action]()
else:
print_error("Invalid selection. Please choose a valid number.")
except ValueError:
print_error("Please enter a valid number.")
except KeyboardInterrupt:
print("\n\nProcess interrupted by user.\n")
sys.exit(0)
except Exception as e:
print_error(f"Main process error: {str(e)}")
if __name__ == "__main__":
main()