diff options
| -rw-r--r-- | bot/utils/redis_cache.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bot/utils/redis_cache.py b/bot/utils/redis_cache.py index a1196fcb5..895a12da4 100644 --- a/bot/utils/redis_cache.py +++ b/bot/utils/redis_cache.py @@ -129,20 +129,20 @@ class RedisCache: async def _validate_cache(self) -> None: """Validate that the RedisCache is ready to be used.""" - if self.bot is None: + if self._namespace is None: error_message = ( - "Critical error: RedisCache has no `Bot` instance. " - "This happens when the class RedisCache was created in doesn't " - "have a Bot instance. Please make sure that you're instantiating " - "the RedisCache inside a class that has a Bot instance attribute." + "Critical error: RedisCache has no namespace. " + "This object must be initialized as a class attribute." ) log.error(error_message) raise RuntimeError(error_message) - if self._namespace is None: + if self.bot is None: error_message = ( - "Critical error: RedisCache has no namespace. " - "This object must be initialized as a class attribute." + "Critical error: RedisCache has no `Bot` instance. " + "This happens when the class RedisCache was created in doesn't " + "have a Bot instance. Please make sure that you're instantiating " + "the RedisCache inside a class that has a Bot instance attribute." ) log.error(error_message) raise RuntimeError(error_message) |