def __init__(self, bot):
super().__init__(bot)
addr = getattr(bot.config, 'MONGO_LOC', None)
self.mongo_client = motor.motor_asyncio.AsyncIOMotorClient(addr)
self.bot.mongo = self.mongo_client
self.jose_db = self.mongo_client['jose']
self.config_coll = self.jose_db['config']
self.block_coll = self.jose_db['block']
self.bot.block_coll = self.block_coll
# querying the db every time is not worth it
self.config_cache = collections.defaultdict(dict)
# used to check if cache has all defined objects in it
self.default_keys = None
评论列表
文章目录