diff --git a/src/db/chat.rs b/src/db/chat.rs index 7f67a93..9443022 100644 --- a/src/db/chat.rs +++ b/src/db/chat.rs @@ -11,7 +11,7 @@ pub async fn create_chat(db: &DbPool, chat: &types::Chat) -> Result Result { +pub async fn create_user(db: &DbPool, user: &types::User) -> Result { sqlx::query( r#"INSERT OR IGNORE INTO "user" (tg_id, username, first_name, last_name, can_download, is_admin, has_private_chat) @@ -18,8 +13,8 @@ pub async fn create_user( .bind(&user.username) .bind(&user.first_name) .bind(&user.last_name) - .bind(can_download as i64) - .bind(is_admin as i64) + .bind(false) + .bind(false) .bind(0) .execute(db) .await?; @@ -38,5 +33,5 @@ pub async fn find_or_create_user(db: &DbPool, user: &types::User) -> Result