Fix call skipping message

This commit is contained in:
2025-08-23 01:17:02 -03:00
parent d0aa3d72d5
commit 6df7fd272f
3 changed files with 26 additions and 2 deletions
+19
View File
@@ -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 {