Skip to content

Commit

Permalink
Only send data if there is actual data
Browse files Browse the repository at this point in the history
  • Loading branch information
Exanlv committed Feb 28, 2024
1 parent b11ef16 commit 1ee640d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Interaction/Helpers/InteractionCallbackBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ public function get(): array|MultipartBody

$data = [
'type' => $this->type->value,
'data' => $callbackData,
];

if ($callbackData !== []) {
$data['data'] = $callbackData;
}

if ($this->requiresMultipart()) {
return $this->getMultipart($data);
}
Expand Down

0 comments on commit 1ee640d

Please sign in to comment.