예제 #1
0
    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._configure_logging()

        self._db = AsyncIOMotorClient(self.config.mongo_uri).modmail_bot
        self._api = SelfHostedClient(self)
        self.plugin_db = PluginDatabaseClient(self)

        self.metadata_task = self.loop.create_task(self.metadata_loop())
        self.autoupdate_task = self.loop.create_task(self.autoupdate_loop())
        self._load_extensions()
예제 #2
0
파일: bot.py 프로젝트: ethann-c/modmail
    def __init__(self):
        super().__init__(command_prefix=None)  # implemented in `get_prefix`
        self._threads = None
        self._session = None
        self._config = None
        self._connected = asyncio.Event()
        self._db = None

        if self.self_hosted:
            self._db = AsyncIOMotorClient(self.config.mongo_uri).modmail_bot
            self._api = SelfHostedClient(self)
        else:
            self._api = ModmailApiClient(self)

        self.data_task = self.loop.create_task(self.data_loop())
        self.autoupdate_task = self.loop.create_task(self.autoupdate_loop())
        self._load_extensions()
        self.owner = None