PHP Class Longman\TelegramBot\Entities\Keyboard

Inheritance: extends Entity
Afficher le fichier Open project: akalongman/php-telegram-bot Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
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 ( )

Method Details

__construct() public méthode

public __construct ( $data = [] )

addRow() public méthode

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

createFromParams() protected méthode

If no explicit keyboard is passed, try to create one from the parameters.
protected createFromParams ( ) : array
Résultat array

forceReply() public static méthode

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
Résultat Keyboard

getKeyboardButtonClass() public méthode

Get the proper keyboard button class for this keyboard.
public getKeyboardButtonClass ( ) : KeyboardButton | InlineKeyboardButton
Résultat KeyboardButton | InlineKeyboardButton

getKeyboardType() public méthode

Get the type of keyboard, either "inline_keyboard" or "keyboard".
public getKeyboardType ( ) : string
Résultat string

isInlineKeyboard() public méthode

If this keyboard is an inline keyboard.
public isInlineKeyboard ( ) : boolean
Résultat boolean

parseButton() protected méthode

Parse a given button to the correct KeyboardButton object type.
protected parseButton ( array | string | KeyboardButton $button ) : KeyboardButton | null
$button array | string | KeyboardButton
Résultat KeyboardButton | null

parseRow() protected méthode

Parse a given row to the correct array format.
protected parseRow ( array $row ) : array
$row array
Résultat array

remove() public static méthode

Remove the current custom keyboard and display the default letter-keyboard.
public static remove ( array $data = [] ) : Keyboard
$data array
Résultat Keyboard

validate() protected méthode

protected validate ( )