From 7b3cf0dc950feedfb88e920f2f3fc8cd5d813eab Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 3 May 2022 01:11:49 -0600 Subject: [PATCH] Construct redis instance to pass into client --- jarvis/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jarvis/__init__.py b/jarvis/__init__.py index ba9c9ed..e30ff64 100644 --- a/jarvis/__init__.py +++ b/jarvis/__init__.py @@ -1,6 +1,7 @@ """Main JARVIS package.""" import logging +import aioredis import jurigged import rook from jarvis_core.db import connect @@ -30,13 +31,17 @@ async def run() -> None: intents = ( Intents.DEFAULT | Intents.MESSAGES | Intents.GUILD_MEMBERS | Intents.GUILD_MESSAGE_CONTENT ) + redis_config = jconfig.redis.copy() + redis_host = redis_config.pop("host") + + redis = await aioredis.from_url(redis_host, **redis_config) jarvis = Jarvis( intents=intents, sync_interactions=jconfig.sync, delete_unused_application_cmds=True, send_command_tracebacks=False, - redis=jconfig.redis, + redis=redis, ) if jconfig.log_level == "DEBUG":