Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 3d46fc9

Browse files
authored
Merge pull request #30 from megazoll/inline-buttons
2 parents 7ce7638 + c600119 commit 3d46fc9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Telegram/Types/Custom/InlineKeyboardButtonArray.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ class InlineKeyboardButtonArray extends CustomType implements CustomArrayType
1717
public function __construct(array $data = null, LoggerInterface $logger = null)
1818
{
1919
if (count($data) !== 0) {
20-
foreach ($data as $rowId => $button) {
21-
$this->data[$rowId][] = new Button($data, $logger);
20+
foreach ($data as $rowId => $buttons) {
21+
$rowButtons = [];
22+
foreach ($buttons as $button) {
23+
$rowButtons[] = new Button($button, $logger);
24+
}
25+
$this->data[$rowId] = $rowButtons;
2226
}
2327
}
2428
}

0 commit comments

Comments
 (0)