change how webhook information is in the webhook

This commit is contained in:
Zomatree
2023-04-01 22:49:34 +01:00
parent 01577fd798
commit 7b39f4e9d9
15 changed files with 31 additions and 33 deletions

View File

@@ -8,7 +8,7 @@ use revolt_quark::{Db, Ref, Result, EmptyResponse, Error};
pub async fn req(db: &Db, target: Ref, token: String) -> Result<EmptyResponse> {
let webhook = target.as_webhook(db).await?;
(webhook.token == token)
(webhook.token.as_deref() == Some(&token))
.then_some(())
.ok_or(Error::InvalidCredentials)?;