PHP Класс Longman\TelegramBot\Entities\Keyboard

Наследование: extends Entity
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( $data = [] )
addRow ( ) Create a new row in keyboard and add buttons.
forceReply ( array $data = [] ) : Keyboard Display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply').
getKeyboardButtonClass ( ) : KeyboardButton | InlineKeyboardButton Get the proper keyboard button class for this keyboard.
getKeyboardType ( ) : string Get the type of keyboard, either "inline_keyboard" or "keyboard".
isInlineKeyboard ( ) : boolean If this keyboard is an inline keyboard.
remove ( array $data = [] ) : Keyboard Remove the current custom keyboard and display the default letter-keyboard.

Защищенные методы

Метод Описание
createFromParams ( ) : array If no explicit keyboard is passed, try to create one from the parameters.
parseButton ( array | string | KeyboardButton $button ) : KeyboardButton | null Parse a given button to the correct KeyboardButton object type.
parseRow ( array $row ) : array Parse a given row to the correct array format.
validate ( )

Описание методов

__construct() публичный Метод

public __construct ( $data = [] )

addRow() публичный Метод

Create a new row in keyboard and add buttons.
public addRow ( )

createFromParams() защищенный Метод

If no explicit keyboard is passed, try to create one from the parameters.
protected createFromParams ( ) : array
Результат array

forceReply() публичный статический Метод

Display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply').
public static forceReply ( array $data = [] ) : Keyboard
$data array
Результат Keyboard

getKeyboardButtonClass() публичный Метод

Get the proper keyboard button class for this keyboard.
public getKeyboardButtonClass ( ) : KeyboardButton | InlineKeyboardButton
Результат KeyboardButton | InlineKeyboardButton

getKeyboardType() публичный Метод

Get the type of keyboard, either "inline_keyboard" or "keyboard".
public getKeyboardType ( ) : string
Результат string

isInlineKeyboard() публичный Метод

If this keyboard is an inline keyboard.
public isInlineKeyboard ( ) : boolean
Результат boolean

parseButton() защищенный Метод

Parse a given button to the correct KeyboardButton object type.
protected parseButton ( array | string | KeyboardButton $button ) : KeyboardButton | null
$button array | string | KeyboardButton
Результат KeyboardButton | null

parseRow() защищенный Метод

Parse a given row to the correct array format.
protected parseRow ( array $row ) : array
$row array
Результат array

remove() публичный статический Метод

Remove the current custom keyboard and display the default letter-keyboard.
public static remove ( array $data = [] ) : Keyboard
$data array
Результат Keyboard

validate() защищенный Метод

protected validate ( )