21 lines
654 B
Python
21 lines
654 B
Python
import logging
|
|
from logging import Logger
|
|
|
|
from libbot.cache.classes import CacheMemcached, CacheRedis
|
|
from libbot.cache.manager import create_cache_client
|
|
from libbot.pycord.classes import PycordBot
|
|
|
|
logger: Logger = logging.getLogger(__name__)
|
|
|
|
|
|
class HoloBot(PycordBot):
|
|
cache: CacheMemcached | CacheRedis | None = None
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
super().__init__(*args, **kwargs)
|
|
self._set_cache_engine()
|
|
|
|
def _set_cache_engine(self) -> None:
|
|
if "cache" in self.config and self.config["cache"]["type"] is not None:
|
|
self.cache = create_cache_client(self.config, self.config["cache"]["type"])
|