now poles reset the day at 22:00

This commit is contained in:
2024-09-25 20:09:32 +02:00
parent 86c898e543
commit 24a4624c9d

View File

@@ -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 {