l,listen: listen for new tweets from all accounts; will not terminate unless error occurs
c,catchup: scan all tweets from all accounts; will terminate when done'''
definit_argparse():
p=argparse.ArgumentParser(description='Twitter bot that follows interactions between Nijisanji EN/ID and hololive EN/ID members.',formatter_class=RawTextHelpFormatter)
p.add_argument('mode',nargs='?', \
help=MODES_HELP_STR)
p.add_argument('--show-tokens',action='store_true',help='[DO NOT USE IN PUBLIC SETTING] print stored tokens from secrets.ini')
returnp
# TODO: implement command line mode for manually controlling the bot
defcommand_line():
pass
defmain():
parser=init_argparse()
iflen(sys.argv)<2:
parser.print_help()
return
args=parser.parse_args()
ifargs.show_tokens:
print(api_secrets.get_all_secrets())
ifargs.modeisNone:return
## We expect to run in some mode now.
# Initialize shared API instance
twApi=TwAPI.instance=TwAPI()
# Initialize talent account lists
talent_lists.init()
## Determine running mode
matchargs.mode.lower():
case'l'|'listen':
print('RUNNING IN LISTEN MODE\n')
listen.run()
case'c'|'catchup':
print('RUNNING IN CATCH-UP MODE\n')
catchup.run()
case_:
command_line()
#TODO: remove message
print('\ninvalid mode. run with no arguments or "-h" for help page, including mode list.')