From b86c38367a1d36fe039c7b596c0daf66b61093ce Mon Sep 17 00:00:00 2001 From: Ananth Bhaskararaman Date: Sun, 28 Aug 2022 17:32:56 +0530 Subject: [PATCH] Import aioredis from redis module too aioredis is available in redis-py as of version 4.2.0rc1: https://github.com/aio-libs/aioredis-py#-aioredis-is-now-in-redis-py-420rc1- Try importing from the new package as well. --- telebot/asyncio_storage/redis_storage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telebot/asyncio_storage/redis_storage.py b/telebot/asyncio_storage/redis_storage.py index e31ddb0..bc9ba54 100644 --- a/telebot/asyncio_storage/redis_storage.py +++ b/telebot/asyncio_storage/redis_storage.py @@ -6,7 +6,10 @@ redis_installed = True try: import aioredis except: - redis_installed = False + try: + from redis import asyncio as aioredis + except: + redis_installed = False class StateRedisStorage(StateStorageBase):