Skip to content

Fix hidekeyboard command #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions examples/Commands/HidekeyboardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
namespace Longman\TelegramBot\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request;
use Longman\TelegramBot\Entities\ReplyKeyboardHide;
use Longman\TelegramBot\Entities\ReplyKeyboardMarkup;
use Longman\TelegramBot\Request;

/**
* User "/hidekeyboard" command
Expand All @@ -25,7 +26,7 @@ class HidekeyboardCommand extends UserCommand
protected $name = 'hidekeyboard';
protected $description = 'Hide the custom keyboard';
protected $usage = '/hidekeyboard';
protected $version = '0.0.5';
protected $version = '0.0.6';
/**#@-*/

/**
Expand All @@ -36,10 +37,11 @@ public function execute()
$message = $this->getMessage();
$chat_id = $message->getChat()->getId();

$data = [];
$data['chat_id'] = $chat_id;
$data['text'] = 'Keyboard Hided';
$data['reply_markup'] = new ReplyKeyboardHide([ 'selective' => false]);
$data = [
'chat_id' => $chat_id,
'text' => 'Keyboard Hidden',
'reply_markup' => new ReplyKeyboardHide(['selective' => false]),
];

return Request::sendMessage($data);
}
Expand Down