Update ping_bot.rs
@@ -8,13 +8,10 @@ use teloxide::{
Bot,
};
-extern crate pretty_env_logger;
-#[macro_use]
-extern crate log;
-
#[tokio::main]
async fn main() {
pretty_env_logger::init();
+
let bot = &Bot::new("1061598315:AAErEDodTsrqD3UxA_EvFyEfXbKA6DT25G0");
let mut updater = Box::pin(polling_default(bot));
let handler = |s, upd: Update| async move {
@@ -28,11 +25,11 @@ async fn main() {
SessionState::Continue(s)
};
let mut dp = Dispatcher::<'_, (), _>::new(handler);
- info!("Starting the message handler.");
+ log::info!("Starting the message handler.");
loop {
let u = updater.next().await.unwrap();
match u {
- Err(e) => error!("{}", e),
+ Err(e) => log::error!("{}", e),
Ok(u) => {
let _ = dp.dispatch(u).await;
}
