now poles reset the day at 22:00
This commit is contained in:
parent
86c898e543
commit
24a4624c9d
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user