aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--botcore/_bot.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/botcore/_bot.py b/botcore/_bot.py
index a36dba15..e9eba5c5 100644
--- a/botcore/_bot.py
+++ b/botcore/_bot.py
@@ -17,8 +17,10 @@ from botcore.utils.logging import get_logger
try:
from async_rediscache import RedisSession
+ REDIS_AVAILABLE = True
except ImportError:
- RedisSession = discord.utils._MissingSentinel
+ RedisSession = None
+ REDIS_AVAILABLE = False
log = get_logger()
@@ -70,7 +72,7 @@ class BotBase(commands.Bot):
self.api_client = api_client
self.statsd_url = statsd_url
- if redis_session and RedisSession == discord.utils._MissingSentinel:
+ if redis_session and not REDIS_AVAILABLE:
warnings.warn("redis_session kwarg passed, but async-rediscache not installed!")
elif redis_session:
self.redis_session = redis_session