Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
v2.4.3 get users only if within last 45 days
  • Loading branch information
brucewzj99 committed Dec 31, 2024
commit c74d745f40a959f54a7705317758bbc1e92de722
3 changes: 2 additions & 1 deletion bot/database_service/firestore_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading