Skip to content

Commit

Permalink
fix: Ensure Payload Data Exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Icebluewolf committed Dec 28, 2024
1 parent fb09d53 commit 75b7ef0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion discord/webhook/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ def create_interaction_response(

if data is not None:
payload["data"] = data
else:
payload["data"] = {}
form = [{"name": "payload_json"}]
attachments = []
files = files or []
Expand All @@ -522,7 +524,8 @@ def create_interaction_response(
"content_type": "application/octet-stream",
}
)
payload["data"]["attachments"] = attachments
if attachments:
payload["data"]["attachments"] = attachments
form[0]["value"] = utils._to_json(payload)

route = Route(
Expand Down

0 comments on commit 75b7ef0

Please sign in to comment.