diff --git a/bot/database_service/firestore_service.py b/bot/database_service/firestore_service.py index a3c776f..7398a77 100644 --- a/bot/database_service/firestore_service.py +++ b/bot/database_service/firestore_service.py @@ -99,7 +99,8 @@ def get_user_sheet_id(self, telegram_id, telegram_username): # Get all user IDs def get_all_user_id(self): try: - users_ref = self.db.collection(self.collection_name) + two_months_ago = datetime.now() - timedelta(days=45) + users_ref = self.db.collection(self.collection_name).where('last_accessed', '>=', two_months_ago) user_ids = [int(user.id) for user in users_ref.stream()] return user_ids except Exception as e: