fix: small fixes to actually make it work

This commit is contained in:
silver 2024-08-31 19:21:01 +01:00
parent bda3fbe2ad
commit 5c2502f726
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D
3 changed files with 37 additions and 14 deletions

View file

@ -218,6 +218,28 @@ impl<'r> FromRow<'r, SqliteRow> for WolvesVerify {
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct Committee {
pub email: String,
pub discord: UserId,
pub auth_code: String,
pub committee: i64,
}
impl<'r> FromRow<'r, SqliteRow> for Committee {
fn from_row(row: &'r SqliteRow) -> Result<Self, Error> {
let user_tmp: i64 = row.try_get("discord")?;
let discord = UserId::from(user_tmp as u64);
Ok(Self {
email: row.try_get("email")?,
discord,
auth_code: row.try_get("auth_code")?,
committee: row.try_get("committee")?,
})
}
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct Servers {
pub server: GuildId,