diff --git a/src/Discord/Parts/Channel/Poll/Poll.php b/src/Discord/Parts/Channel/Poll/Poll.php index 674edb730..1d19b2510 100644 --- a/src/Discord/Parts/Channel/Poll/Poll.php +++ b/src/Discord/Parts/Channel/Poll/Poll.php @@ -100,13 +100,19 @@ public function addAnswer(PollAnswer|PollMedia|array|string $answer): self return $this; } - $answer = is_string($answer) - ? ['text' => $answer] - : $answer; + $text = is_string($answer) + ? $answer + : $answer['text']; + + $emoji = $answer['emoji'] ?? null; $answer = $answer instanceof PollMedia ? $answer - : new PollMedia($this->discord, $answer); + : new PollMedia($this->discord); + + $answer + ->setText($text) + ->setEmoji($emoji); if (poly_strlen($answer->text) > 55) { throw new \LengthException('Answer must be maximum 55 characters.');