Commit 35394a63 authored by MBoretto's avatar MBoretto

Moving examples to CommandsExamples

parent ac2bbc94
...@@ -41,16 +41,10 @@ class ForceReplyCommand extends Command ...@@ -41,16 +41,10 @@ class ForceReplyCommand extends Command
$data['text'] = 'Write something:'; $data['text'] = 'Write something:';
#$data['reply_to_message_id'] = $message_id; #$data['reply_to_message_id'] = $message_id;
$json = ( $force_reply = new ForceReply(['selective' => false]);
new ForceReply(
array(
'selective' => false
)
)
)->toJSON();
#echo $json; #echo $json;
$data['reply_markup'] = $json; $data['reply_markup'] = $force_reply;
$result = Request::sendMessage($data); $result = Request::sendMessage($data);
......
...@@ -41,15 +41,9 @@ class HidekeyboardCommand extends Command ...@@ -41,15 +41,9 @@ class HidekeyboardCommand extends Command
$data['text'] = 'Keyboard Hided'; $data['text'] = 'Keyboard Hided';
#$data['reply_to_message_id'] = $message_id; #$data['reply_to_message_id'] = $message_id;
$json = ( $reply_keyboard_hide = new ReplyKeyboardHide([ 'selective' => false]);
new ReplyKeyBoardHide(
array( $data['reply_markup'] = $reply_keyboard_hide;
'selective' => false
)
)
)->toJSON();
$data['reply_markup'] = $json;
$result = Request::sendMessage($data); $result = Request::sendMessage($data);
return $result; return $result;
......
...@@ -84,18 +84,16 @@ class KeyboardCommand extends Command ...@@ -84,18 +84,16 @@ class KeyboardCommand extends Command
unset($keyboard); unset($keyboard);
$json = ( $reply_keyboard_markup = new ReplyKeyboardMarkup(
new ReplyKeyboardMarkup( [
array( 'keyboard' => $keyboards[1] ,
'keyboard' => $keyboards[1] , 'resize_keyboard' => true,
'resize_keyboard' => true, 'one_time_keyboard' => false,
'one_time_keyboard' => false, 'selective' => false
'selective' => false ]
) );
)
)->toJSON();
#echo $json; #echo $json;
$data['reply_markup'] = $json; $data['reply_markup'] = $reply_keyboard_markup;
$result = Request::sendMessage($data); $result = Request::sendMessage($data);
return $result; return $result;
......
...@@ -279,7 +279,7 @@ class DB ...@@ -279,7 +279,7 @@ class DB
$sth2->bindParam(':id', $chat_id, \PDO::PARAM_INT); $sth2->bindParam(':id', $chat_id, \PDO::PARAM_INT);
$sth2->bindParam(':title',$chat->getTitle() , \PDO::PARAM_STR, 255); $sth2->bindParam(':title', $chat->getTitle(), \PDO::PARAM_STR, 255);
$sth2->bindParam(':date', $date, \PDO::PARAM_STR); $sth2->bindParam(':date', $date, \PDO::PARAM_STR);
$status = $sth2->execute(); $status = $sth2->execute();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment