From ed0c79b67f93cc593da299db709b48194ca2f7e8 Mon Sep 17 00:00:00 2001 From: LWR Date: Sun, 28 May 2023 16:23:19 +0800 Subject: [PATCH] fix: Fixed importing aioredis causing an error in Python 3.11 --- starbot/utils/redis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starbot/utils/redis.py b/starbot/utils/redis.py index b72e80d..487fb72 100644 --- a/starbot/utils/redis.py +++ b/starbot/utils/redis.py @@ -1,7 +1,7 @@ from typing import Any, Union, Tuple, List, Set -import aioredis from loguru import logger +from redis import asyncio as aioredis from ..exception.RedisException import RedisException from ..utils import config @@ -32,7 +32,7 @@ async def expire(key: str, seconds: int): async def exists(key: str) -> bool: - return await __redis.exists(key) + return bool(await __redis.exists(key)) async def get(key: str) -> str: