From c13a35e911fd1f5490f798b278b8160368a94f7c Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 27 Apr 2023 18:05:20 -0400 Subject: [PATCH] Fix channel edits on webhooks sending two requests --- discord/webhook/async_.py | 3 +-- discord/webhook/sync.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 1350b9d91..8a89bff80 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1299,8 +1299,7 @@ class Webhook(BaseWebhook): proxy_auth=self.proxy_auth, reason=reason, ) - - if prefer_auth and self.auth_token: + elif prefer_auth and self.auth_token: data = await adapter.edit_webhook( self.id, self.auth_token, diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index 00fc33136..398342761 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -834,8 +834,7 @@ class SyncWebhook(BaseWebhook): payload['channel_id'] = channel.id data = adapter.edit_webhook(self.id, self.auth_token, payload=payload, session=self.session, reason=reason) - - if prefer_auth and self.auth_token: + elif prefer_auth and self.auth_token: data = adapter.edit_webhook(self.id, self.auth_token, payload=payload, session=self.session, reason=reason) elif self.token: data = adapter.edit_webhook_with_token(self.id, self.token, payload=payload, session=self.session, reason=reason)