PHP code example of devrabie / fluent-keyboard_plus
1. Go to this page and download the library: Download devrabie/fluent-keyboard_plus library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
devrabie / fluent-keyboard_plus example snippets
Request::sendMessage([
'chat_id' => 12345,
'text' => 'Keyboard Example',
'reply_markup' => ReplyKeyboardMarkup::make()
->oneTimeKeyboard()
->button(KeyboardButton::make('Cancel'))
->button(KeyboardButton::make('OK')),
]);
ReplyKeyboardMarkup::make()
->inputFieldPlaceholder('Placeholder');
KeyboardButton::make()
->text('Send my Contact')
->requestContact();
KeyboardButton::make('Send my Location')
->requestLocation();
InlineKeyboardButton::make('Login')
->loginUrl(['url' => 'https://example.com']);
InlineKeyboardMarkup::make()
->row([
InlineKeyboardButton::make('New User')
->iconCustomEmojiId('5877530150345641603')
->style('primary')
->callbackData('add_user'),
InlineKeyboardButton::make('Search')
->iconCustomEmojiId('5942826671290715541')
->style('primary')
->callbackData('search')
])
->row([
InlineKeyboardButton::make('Block')
->iconCustomEmojiId('5922712343011135025')
->style('danger')
->callbackData('block'),
InlineKeyboardButton::make('Verify')
->iconCustomEmojiId('5951665890079544884')
->style('success')
->callbackData('verify')
]);
ReplyKeyboardMarkup::make()
->row([
KeyboardButton::make('Cancel'),
KeyboardButton::make('OK')
]);
InlineKeyboardMarkup::make()
->row([
InlineKeyboardButton::make('1')->callbackData('page-1'),
InlineKeyboardButton::make('2')->callbackData('page-2'),
InlineKeyboardButton::make('3')->callbackData('page-3')
])
->row([
InlineKeyboardButton::make('prev')->callbackData('page-prev'),
InlineKeyboardButton::make('next')->callbackData('page-next')
]);
ReplyKeyboardMarkup::make()
->button(KeyboardButton::make('First Button'))
->button(KeyboardButton::make('Second Button'));
InlineKeyboardMarkup::make()
->button(InlineKeyboardButton::make('A')->callbackData('answer-a'))
->button(InlineKeyboardButton::make('B')->callbackData('answer-b'))
->row()
->button(InlineKeyboardButton::make('C')->callbackData('answer-c'))
->button(InlineKeyboardButton::make('D')->callbackData('answer-d'));
InlineKeyboardMarkup::make()
->stack([
InlineKeyboardButton::make('Login')->loginUrl('https://example.com/login'),
InlineKeyboardButton::make('Visit Homepage')->url('https://example.com')
]);
$this->replyToUser('Thank you', [
'reply_markup' => ReplyKeyboardRemove::make()->selective(),
]);
$data['reply_markup'] = ForceReply::make()->inputFieldPlaceholder('Please type something...');
KeyboardButton::make()->requestPoll(KeyboardButtonPollType::regular())
$pollButton = new KeyboardButtonPollType([
'type' => 'quiz'
]);