Skip to content

Commit a43eb81

Browse files
committed
Container::addComponent logic simplification
This also extends the same logic to other Interactive types such as TextInput. If Discord adds similar objects in the future they are expected to also be extendable from Interactive, further futureproofing this function
1 parent ea89d54 commit a43eb81

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Discord/Builders/Components/Container.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@ protected static function resolveColor($color): int
104104
*/
105105
public function addComponent(ComponentObject $component): self
106106
{
107-
if ($component instanceof SelectMenu) {
108-
$component = ActionRow::new()->addComponent($component);
109-
}
110-
111-
if ($component instanceof Button) {
107+
if ($component instanceof Interactive) {
112108
$component = ActionRow::new()->addComponent($component);
113109
}
114110

0 commit comments

Comments
 (0)