PHP Class Telegram\Bot\Keyboard\Keyboard

For Standard Keyboard $params = [ 'keyboard' => '', 'resize_keyboard' => '', 'one_time_keyboard' => '', 'selective' => '', ]; OR For Inline Keyboard $params = [ 'inline_keyboard' => '', ];
Inheritance: extends Base
Afficher le fichier Open project: irazasyed/telegram-bot-sdk Class Usage Examples

Protected Properties

Свойство Type Description
$inline boolean Make an Inline Keyboard

Méthodes publiques

Méthode Description
button ( string | array $params = [] ) : mixed Represents one button of the Reply keyboard.
forceReply ( array $params = [] ) : string Display a reply interface to the user (act as if the user has selected the bot‘s message and tapped ’Reply').
hide ( array $params = [] ) : string Hide the current custom keyboard and display the default letter-keyboard.
inline ( ) Make this keyboard inline, So it appears right next to the message it belongs to.
inlineButton ( string | array $params = [] ) : string Represents one button of an inline keyboard.
isInlineKeyboard ( ) : boolean Determine if it's an inline keyboard.
row ( ) Create a new row in keyboard to add buttons.

Method Details

button() public static méthode

For simple text buttons String can be used instead of an array. You can also utilise the fluent API to build the params payload. $params = 'string' OR $params = [ 'text' => '', 'request_contact' => '', 'request_location' => '', ];
public static button ( string | array $params = [] ) : mixed
$params string | array
Résultat mixed

forceReply() public static méthode

$params = [ 'force_reply' => true, 'selective' => false, ];
public static forceReply ( array $params = [] ) : string
$params array
Résultat string

hide() public static méthode

$params = [ 'hide_keyboard' => true, 'selective' => false, ];
public static hide ( array $params = [] ) : string
$params array
Résultat string

inline() public méthode

Make this keyboard inline, So it appears right next to the message it belongs to.
public inline ( )

inlineButton() public static méthode

You must use exactly one of the optional fields. You can also utilise the fluent API to build the params payload. $params = [ 'text' => '', 'url' => '', 'callback_data' => '', 'switch_inline_query' => '', ];
public static inlineButton ( string | array $params = [] ) : string
$params string | array
Résultat string

isInlineKeyboard() public méthode

Determine if it's an inline keyboard.
public isInlineKeyboard ( ) : boolean
Résultat boolean

row() public méthode

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

Property Details

$inline protected_oe property

Make an Inline Keyboard
protected bool $inline
Résultat boolean