From ce867289e5c7737b20e602535fd65912f8a76b76 Mon Sep 17 00:00:00 2001 From: DevGuyAhnaf <57180217+ahnaf-zamil@users.noreply.github.com> Date: Mon, 24 Jan 2022 09:29:13 +0600 Subject: [PATCH] GatewayBot takes custom cache impl as constructor arg --- hikari/impl/bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hikari/impl/bot.py b/hikari/impl/bot.py index d31213ad16..5353e3efaf 100644 --- a/hikari/impl/bot.py +++ b/hikari/impl/bot.py @@ -315,6 +315,7 @@ def __init__( allow_color: bool = True, banner: typing.Optional[str] = "hikari", executor: typing.Optional[concurrent.futures.Executor] = None, + cache: typing.Optional[cache_.MutableCache] = None, force_color: bool = False, cache_settings: typing.Optional[config.CacheSettings] = None, http_settings: typing.Optional[config.HTTPSettings] = None, @@ -341,7 +342,7 @@ def __init__( # Caching cache_settings = cache_settings if cache_settings is not None else config.CacheSettings() - self._cache = cache_impl.CacheImpl(self, cache_settings) + self._cache = cache or cache_impl.CacheImpl(self, cache_settings) # Entity creation self._entity_factory = entity_factory_impl.EntityFactoryImpl(self)