from argparse import ArgumentParser import logging from pathlib import Path from breadtube_bot.bot import Bot def main(): parser = ArgumentParser('BreadTube-bot') parser.add_argument('--guild', type=int, default=1306964577812086824, help='Guild id to manage') parser.add_argument('--debug', action='store_true', default=False, help='Run in debug mode (for logs)') arguments = parser.parse_args() debug_mode: bool = arguments.debug guild_id: int = arguments.guild del arguments bot_token = Path('data/discord_bot_token.txt').read_text(encoding='utf-8').strip() manager = Bot(bot_token=bot_token, guild_id=guild_id, log_level=logging.DEBUG if debug_mode else logging.INFO) try: manager.run() except KeyboardInterrupt: print('\r ') # noqa: T201 if __name__ == '__main__': main()