Skip to content

Commit

Permalink
fix db
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Jan 5, 2025
1 parent 3c3ba30 commit 7fe604d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bot/helper/ext_utils/db_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,19 @@ async def add_incomplete_task(self, cid, link, tag):
async def get_pm_uids(self):
if self._return:
return None
return [doc["_id"] async for doc in self._db.pm_users[TgClient.ID].find({})]
return [doc["_id"] async for doc in self.db.pm_users[TgClient.ID].find({})]

async def update_pm_users(self, user_id):
if self._return:
return
if not bool(await self._db.pm_users[TgClient.ID].find_one({"_id": user_id})):
await self._db.pm_users[TgClient.ID].insert_one({"_id": user_id})
if not bool(await self.db.pm_users[TgClient.ID].find_one({"_id": user_id})):
await self.db.pm_users[TgClient.ID].insert_one({"_id": user_id})
LOGGER.info(f"New PM User Added : {user_id}")

async def rm_pm_user(self, user_id):
if self._return:
return
await self._db.pm_users[TgClient.ID].delete_one({"_id": user_id})
await self.db.pm_users[TgClient.ID].delete_one({"_id": user_id})

async def update_user_tdata(self, user_id, token, time):
if self._return:
Expand Down

0 comments on commit 7fe604d

Please sign in to comment.