Skip to content

Commit

Permalink
Docs for Section addComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming authored Feb 25, 2025
1 parent fb211d5 commit fe13130
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Discord/Builders/Components/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public static function new(): self
/**
* Adds a text display component to the section.
* Text displays can only be used within sections.
* Use setAccessory() instead for Thumbnail or Button.
*
* @param Component $component Text display component to add.
* @param TextDisplay $component Text display component to add.
*
* @throws \InvalidArgumentException Component is not a TextDisplay.
* @throws \OverflowException Section exceeds 3 text components.
Expand All @@ -58,7 +59,7 @@ public static function new(): self
public function addComponent(Component $component): self
{
if (! ($component instanceof TextDisplay)) {
throw new \InvalidArgumentException('Section can only contain TextDisplay components. Use setAccessory() for Thumbnail or Button.');
throw new \InvalidArgumentException('Section can only contain TextDisplay components.');
}

if (count($this->components) >= 3) {
Expand Down

0 comments on commit fe13130

Please sign in to comment.