support more recente teloxide version

This commit is contained in:
2023-03-05 17:33:53 +03:00
parent efede10312
commit 3f348d32cc
11 changed files with 647 additions and 126 deletions

25
src/utils.rs Normal file
View File

@ -0,0 +1,25 @@
pub struct RequestID(String);
impl std::fmt::Display for RequestID {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
#[derive(Clone)]
pub struct Generators;
impl Generators {
pub fn new() -> Self {
Self
}
pub fn next_request_id(&self) -> RequestID {
let data: u32 = rand::random();
let data_hex = format!("{:x}", data);
log::info!("issued new request: {}", data_hex);
RequestID(data_hex)
}
}