blob: 69f5eccd32608d8abee124c558dc364fe0542bd2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
use std::env;
use tokio;
use log::{ info, error };
mod client;
//mod auth;
mod update;
//mod message;
struct UpdateHandler;
impl update::Handler for UpdateHandler {
fn handle(&self, _client: client::Client, req: pert_types::types::Update) -> futures::future::BoxFuture<'static, ()> {
Box::pin(async move {
info!("update: {:#?}", req);
})
}
}
#[tokio::main]
async fn main() {
dotenv::dotenv().ok();
env_logger::init();
let tg_log: Option<i32> = env::var("TG_LOG")
.ok()
.and_then(|var| var.parse().ok());
let tg = client::Client::new(tg_log, UpdateHandler{});
std::thread::sleep(std::time::Duration::new(200, 0));
}
|