Skip to content

Commit

Permalink
Don't send content or embeds if FLAG_IS_V2_COMPONENTS
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming authored Feb 25, 2025
1 parent ab0f4a0 commit 118a8ba
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Discord/Builders/MessageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,10 @@ public function jsonSerialize(): ?array
}

if (isset($this->content)) {
$body['content'] = $this->content;
$empty = false;
if (! ($this->flags & Message::FLAG_IS_V2_COMPONENTS)) {
$body['content'] = $this->content;
$empty = false;
}
}

if (isset($this->username)) {
Expand All @@ -739,8 +741,10 @@ public function jsonSerialize(): ?array
}

if (isset($this->embeds)) {
$body['embeds'] = $this->embeds;
$empty = false;
if (! ($this->flags & Message::FLAG_IS_V2_COMPONENTS)) {
$body['embeds'] = $this->embeds;
$empty = false;
}
}

if (isset($this->poll)) {
Expand Down

0 comments on commit 118a8ba

Please sign in to comment.