support more recente teloxide version
This commit is contained in:
25
src/utils.rs
Normal file
25
src/utils.rs
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user