Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
eliyas5044 committed Jun 20, 2024
1 parent 419d95e commit 0f5304d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,13 +1088,13 @@ def handle_message_events(body, logger):
# store_reminder_ts(channel_id, message_ts)
# logger.info(f"Stored reminder message ts: {message_ts}")

# Convert timestamp to datetime and check if it's 8 PM
# Convert timestamp to datetime and check if it's after 8 PM
reminder_time = datetime.fromtimestamp(float(message_ts))
if reminder_time.hour > 20: # 8 PM in 24-hour format
if reminder_time.hour >= 20: # 8 PM in 24-hour format
store_reminder_ts(channel_id, message_ts)
logger.info(f"Stored reminder message ts: {message_ts}")
else:
logger.info(f"Reminder received at {reminder_time.strftime('%Y-%m-%d %H:%M:%S')}, not storing because it is not 8 PM.")
logger.info(f"Reminder received at {reminder_time.strftime('%Y-%m-%d %H:%M:%S')}, not storing because it is not after 8 PM.")

# Start your app
if __name__ == "__main__":
Expand Down

0 comments on commit 0f5304d

Please sign in to comment.