PHP 클래스 Longman\TelegramBot\Entities\Keyboard

상속: extends Entity
파일 보기 프로젝트 열기: akalongman/php-telegram-bot 1 사용 예제들

공개 메소드들

메소드 설명
__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 ( )