Skip to content

Commit da10065

Browse files
committed
Fix channel edits on webhooks sending two requests
1 parent c57d488 commit da10065

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

discord/webhook/async_.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,8 +1511,7 @@ async def edit(
15111511
proxy_auth=self.proxy_auth,
15121512
reason=reason,
15131513
)
1514-
1515-
if prefer_auth and self.auth_token:
1514+
elif prefer_auth and self.auth_token:
15161515
data = await adapter.edit_webhook(
15171516
self.id,
15181517
self.auth_token,

discord/webhook/sync.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,7 @@ def edit(
835835

836836
payload['channel_id'] = channel.id
837837
data = adapter.edit_webhook(self.id, self.auth_token, payload=payload, session=self.session, reason=reason)
838-
839-
if prefer_auth and self.auth_token:
838+
elif prefer_auth and self.auth_token:
840839
data = adapter.edit_webhook(self.id, self.auth_token, payload=payload, session=self.session, reason=reason)
841840
elif self.token:
842841
data = adapter.edit_webhook_with_token(self.id, self.token, payload=payload, session=self.session, reason=reason)

0 commit comments

Comments
 (0)