Skip to content

Commit

Permalink
Fix message attachment reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Plytas committed Jul 17, 2024
1 parent c607edc commit cf66875
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 cf66875

Please sign in to comment.