From 24a4624c9d376b401b7ff35f4fdfa3eb70035784 Mon Sep 17 00:00:00 2001 From: Guillermo Roche Date: Wed, 25 Sep 2024 20:09:32 +0200 Subject: [PATCH] now poles reset the day at 22:00 --- src/pole_dialogue/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pole_dialogue/mod.rs b/src/pole_dialogue/mod.rs index 31d16ff..7d961ab 100644 --- a/src/pole_dialogue/mod.rs +++ b/src/pole_dialogue/mod.rs @@ -1,12 +1,13 @@ use teloxide::prelude::*; use chrono::Local; +use std::ops::Add; use std::cmp::Ordering::Equal; use std::str; use crate::telegram_utils::*; mod database; fn change_day(last_day: &str) -> bool{ - last_day.cmp(&Local::now().format("%Y-%m-%d").to_string()) != Equal + last_day.cmp(&Local::now().add(chrono::TimeDelta::hours(2)).format("%Y-%m-%d").to_string()) != Equal } fn check_pole(group_id: &str) -> bool {