Browse Source

Fix channel edits on webhooks sending two requests

pull/9378/head
Rapptz 2 years ago
parent
commit
da10065c19
  1. 3
      discord/webhook/async_.py
  2. 3
      discord/webhook/sync.py

3
discord/webhook/async_.py

@ -1511,8 +1511,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,

3
discord/webhook/sync.py

@ -835,8 +835,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)

Loading…
Cancel
Save