Merge pull request #12 from house-of-vanity/libs-bump

Libs bump
This commit is contained in:
House of Vanity
2021-08-19 08:42:00 -07:00
committed by GitHub

View File

@ -1,3 +1,4 @@
#![allow(unreachable_code)]
use std::{env, process};
use futures::StreamExt;
@ -16,7 +17,7 @@ use mystem::MyStem;
#[tokio::main]
async fn main() -> Result<(), errors::Error> {
env_logger::from_env(Env::default().default_filter_or("info")).init();
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
let mut mystem = match MyStem::new() {
Ok(mystem) => mystem,
Err(e) => {
@ -44,16 +45,18 @@ async fn main() -> Result<(), errors::Error> {
me.first_name,
me.id
);
while let Some(update) = stream.next().await {
let update = update?;
if let UpdateKind::Message(message) = update.kind {
db::add_conf(message.clone()).await?;
db::add_user(message.clone()).await?;
match handlers::handler(api.clone(), message, token.clone(), &mut mystem, me.clone())
.await
{
Ok(_) => {}
Err(e) => warn!("An error occurred handling command. {:?}", e),
loop {
while let Some(update) = stream.next().await {
let update = update?;
if let UpdateKind::Message(message) = update.kind {
db::add_conf(message.clone()).await?;
db::add_user(message.clone()).await?;
match handlers::handler(api.clone(), message, token.clone(), &mut mystem, me.clone())
.await
{
Ok(_) => {}
Err(e) => warn!("An error occurred handling command. {:?}", e),
}
}
}
}