Update stats.py with env mongodb

This commit is contained in:
Game_Time 2023-08-17 16:13:20 +05:00 committed by GitHub
parent d741a43b6b
commit b09bf688b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,7 +26,7 @@ class StatsManager:
self.conn = AsyncIOMotorClient(os.getenv('MONGO_URI')) self.conn = AsyncIOMotorClient(os.getenv('MONGO_URI'))
async def _get_collection(self, collection_name: str): async def _get_collection(self, collection_name: str):
return self.conn['nova-core'][collection_name] return self.conn[os.getenv('MONGO_NAME', 'nova-test')][collection_name]
async def add_date(self): async def add_date(self):
date = datetime.datetime.now(pytz.timezone('GMT')).strftime('%Y.%m.%d') date = datetime.datetime.now(pytz.timezone('GMT')).strftime('%Y.%m.%d')