Added methods \TgBotLib\Objects\Telegram\InlineKeyboardMarkup::removeRow
& \TgBotLib\Objects\Telegram\InlineKeyboardMarkup::addRow
to \TgBotLib\Objects\Telegram\InlineKeyboardMarkup
This commit is contained in:
parent
7970313d88
commit
6a4128090c
2 changed files with 25 additions and 0 deletions
|
@ -24,6 +24,7 @@ This update accompanies the release of the [Telegram Bot API 6.7](https://core.t
|
|||
`\TgBotLib\Objects\Telegram\InlineKeyboardButton::setSwitchInlineQuery`, `\TgBotLib\Objects\Telegram\InlineKeyboardButton::setSwitchInlineQueryCurrentChat`,
|
||||
`\TgBotLib\Objects\Telegram\InlineKeyboardButton::setCallbackGame`, `\TgBotLib\Objects\Telegram\InlineKeyboardButton::setPay`
|
||||
to `\TgBotLib\Objects\Telegram\InlineKeyboardButton`
|
||||
* Added methods `\TgBotLib\Objects\Telegram\InlineKeyboardMarkup::removeRow` & `\TgBotLib\Objects\Telegram\InlineKeyboardMarkup::addRow` to `\TgBotLib\Objects\Telegram\InlineKeyboardMarkup`
|
||||
|
||||
## [6.6.0] - 2023-04-10
|
||||
|
||||
|
|
|
@ -24,6 +24,30 @@
|
|||
return $this->inline_keyboard;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a row of buttons
|
||||
*
|
||||
* @param InlineKeyboardButton ...$buttons
|
||||
* @return $this
|
||||
*/
|
||||
public function addRow(InlineKeyboardButton ...$buttons): self
|
||||
{
|
||||
$this->inline_keyboard[] = $buttons;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a row of buttons by index
|
||||
*
|
||||
* @param int $index
|
||||
* @return $this
|
||||
*/
|
||||
public function removeRow(int $index): self
|
||||
{
|
||||
unset($this->inline_keyboard[$index]);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array representation of the object
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue