diff --git a/app/__main__.py b/app/__main__.py index b0f1479..6e26213 100644 --- a/app/__main__.py +++ b/app/__main__.py @@ -1,4 +1,5 @@ import asyncio +import time import click import logging @@ -39,11 +40,22 @@ def cli(log_level: str, log_file: str | None): @cli.command() -def run(): +@click.option( + "--resume/--no-resume", + default=False, + help="Whether to do a full sync, or resume from previous" +) +def run(resume: bool): """Runs the bot""" log.info("Starting bot.") from .main import bot + if resume is False: + bot.config.store_sync_tokens = False + bot.loaded_sync_token = "" + log.critical("Not resuming from previous sync. This may be slow!") + time.sleep(3) + # run_async(bot.start(access_token=bot.cfg["bot"]["access_token"])) asyncio.run(bot.start(access_token=bot.cfg["bot"]["access_token"])) diff --git a/app/main.py b/app/main.py index fd8d394..356fbf8 100644 --- a/app/main.py +++ b/app/main.py @@ -74,8 +74,7 @@ bot = NonsenseBot( store_path=str(store.resolve()), command_prefix=config["bot"].get("prefix", "h!"), owner_id=config["bot"].get("owner_id") or "@nex:nexy7574.co.uk", - auto_read_messages=False, - config=niobot.AsyncClientConfig() + auto_read_messages=False ) bot.cfg = config