Move rook, jurigged start to run

This commit is contained in:
Zeva Rose 2022-04-30 20:51:16 -06:00
parent 5fbd153245
commit 73cb150339

View file

@ -22,15 +22,9 @@ file_handler.setFormatter(
)
logger.addHandler(file_handler)
if jconfig.log_level == "DEBUG":
jurigged.watch()
intents = Intents.DEFAULT | Intents.MESSAGES | Intents.GUILD_MEMBERS | Intents.GUILD_MESSAGE_CONTENT
restart_ctx = None
if jconfig.rook_token:
rook.start(token=jconfig.rook_token, labels={"env": "dev"})
jarvis = Jarvis(
intents=intents,
sync_interactions=jconfig.sync,
@ -41,6 +35,10 @@ jarvis = Jarvis(
async def run() -> None:
"""Run JARVIS"""
if jconfig.log_level == "DEBUG":
jurigged.watch()
if jconfig.rook_token:
rook.start(token=jconfig.rook_token, labels={"env": "dev"})
logger.info("Starting JARVIS")
logger.debug("Connecting to database")
connect(**jconfig.mongo["connect"], testing=jconfig.mongo["database"] != "jarvis")