Skip to content

Commit

Permalink
Fix message attachment reset (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Plytas authored Jul 17, 2024
1 parent c607edc commit 311b03a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Data/DiscordMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,15 @@ public function isMultipart(): bool
{
return $this->files->isNotEmpty();
}

public function toArray(): array
{
$array = parent::toArray();

if ($this->attachments === null) {
unset($array['attachments']);
}

return $array;
}
}

0 comments on commit 311b03a

Please sign in to comment.