Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Add hexcode support to Message::color() (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored May 31, 2024
1 parent 99a62ff commit faf3bb3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Discord/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ public function color(string $color): self
default => $color,
};

if (str_starts_with($color, '#')) {
$color = hexdec(substr($color, 1));
}

$this->color = $color;

return $this;
Expand Down

0 comments on commit faf3bb3

Please sign in to comment.