Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Fix for a bug which inline_keyboard object was incorrectly nested inside another inline_keyboard object!
  • Loading branch information
amirrh6 committed Nov 14, 2024
1 parent 1b284dc commit 9f1d070
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/primary_types.php
Original file line number Diff line number Diff line change
Expand Up @@ -1900,10 +1900,13 @@ public function __construct(array $inline_keyboard)
$this->inline_keyboard = $inline_keyboard;
}

/**
* Serves as an overload of the constructor
*/
public static function __fromDecodedJson($init_data)
{
// @phpstan-ignore new.static
return new static((array) $init_data->reply_markup);
return new static((array) $init_data->reply_markup->inline_keyboard);
}
}

Expand Down

0 comments on commit 9f1d070

Please sign in to comment.