now poles reset the day at 22:00

This commit is contained in:
Guillermo Roche 2024-09-25 20:09:32 +02:00
parent 86c898e543
commit 24a4624c9d
Signed by: groche97
GPG Key ID: 041FB85BEEA4B9B0

View File

@ -1,12 +1,13 @@
use teloxide::prelude::*; use teloxide::prelude::*;
use chrono::Local; use chrono::Local;
use std::ops::Add;
use std::cmp::Ordering::Equal; use std::cmp::Ordering::Equal;
use std::str; use std::str;
use crate::telegram_utils::*; use crate::telegram_utils::*;
mod database; mod database;
fn change_day(last_day: &str) -> bool{ 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 { fn check_pole(group_id: &str) -> bool {