aboutsummaryrefslogtreecommitdiffstats
path: root/botcore
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-05-11 02:39:41 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-05-28 20:37:10 +0400
commite28b42f9b1e085df6961d195abe6a36210d25242 (patch)
tree2a190e311a3222cea684fba8015702e1b95c97ec /botcore
parentMerge pull request #78 from python-discord/bump-d.py (diff)
Remove Discord `MissingSentinel`
Replaces the access to `discord.utils._MissingSentinel` with a simple boolean flag. This has the benefit of behaving more nicely with our doc generation. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'botcore')
-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