feat: reintroduce permission checks for send

This commit is contained in:
Paul Makles
2023-06-03 14:00:17 +01:00
parent 23188032ca
commit a0002d0b43
10 changed files with 82 additions and 57 deletions

View File

@@ -33,6 +33,9 @@ pub async fn webhook_execute(
webhook.assert_token(&token).map_err(Error::from_core)?;
// TODO: webhooks can currently always send masquerades, files, embeds, reactions (interactions)
// TODO: they can also mention anyone
let channel = legacy_db.fetch_channel(&webhook.channel_id).await?;
let message = channel
.send_message(
@@ -40,6 +43,7 @@ pub async fn webhook_execute(
data,
MessageAuthor::Webhook(&webhook.into()),
idempotency,
true,
)
.await?;