def __init__(self): super().__init__(command_prefix=None) # implemented in `get_prefix` self._threads = None self._session = None self._config = None self._db = None self.start_time = datetime.utcnow() self._connected = asyncio.Event() self._configure_logging() # TODO: Raise fatal error if mongo_uri or other essentials are not found self._db = AsyncIOMotorClient(self.config.mongo_uri).modmail_bot self._api = ApiClient(self) self.plugin_db = PluginDatabaseClient(self) self.metadata_task = self.loop.create_task(self.metadata_loop()) self._load_extensions()
def api(self) -> ApiClient: if self._api is None: self._api = ApiClient(self) return self._api