chore: strip bot model from quark

This commit is contained in:
Paul Makles committed 2023-08-26 16:16:48 +01:00
1 parent 2fb9e7a802
commit bde432cb75
12 files changed
+6 -180

No files matched your search

+4 -1
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 {