chore: strip bot model from quark

This commit is contained in:
Paul Makles
2023-08-14 10:14:17 +01:00
parent 2fb9e7a802
commit bde432cb75
12 changed files with 6 additions and 180 deletions

View File

@@ -469,7 +469,10 @@ impl User {
#[async_recursion]
pub async fn from_token(db: &Database, token: &str, hint: UserHint) -> Result<User> {
match hint {
UserHint::Bot => db.fetch_user(&db.fetch_bot_by_token(token).await?.id).await,
UserHint::Bot => {
let rvdb: revolt_database::Database = db.clone().into();
db.fetch_user(&rvdb.fetch_bot_by_token(token).await.map_err(|_| Error::InternalError)?.id).await
},
UserHint::User => db.fetch_user_by_token(token).await,
UserHint::Any => {
if let Ok(user) = User::from_token(db, token, UserHint::User).await {