Fix call skipping message
This commit is contained in:
@@ -286,6 +286,25 @@ impl User {
|
||||
is_first_incident: incidents.is_empty(),
|
||||
})
|
||||
}
|
||||
|
||||
pub async fn count(&self, session: &Session) -> Result<usize, DatabaseError> {
|
||||
let result = session
|
||||
.query_unpaged(
|
||||
r#"
|
||||
SELECT
|
||||
user_id
|
||||
FROM
|
||||
payphone.users;
|
||||
"#,
|
||||
(),
|
||||
)
|
||||
.await
|
||||
.map_err(DatabaseError::QueryError)?
|
||||
.into_rows_result()
|
||||
.map_err(|_| DatabaseError::ResultNotRows)?;
|
||||
|
||||
Ok(result.rows_num())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<TwilightUser> for User {
|
||||
|
||||
Reference in New Issue
Block a user