Api icon indicating copy to clipboard operation
Api copied to clipboard

sendMessage - does not work ReplyKeyboardMarkup with array - text send, keyboard not update

Open irinahart opened this issue 4 years ago • 1 comments

$keyboard = new \TelegramBot\Api\Types\ReplyKeyboardMarkup
	    	(
	    		[
	    			[
						["text" => "Способы голосования"], 
	    				["text" => "Избирательный участок"]
					], 
					[
						["text" => "Даты голосования"],
						["text" => "Кандидаты"]
	    			]
	    		],
	    		false, 
	    		true
	    	);

bot->sendMessage($message->getChat()->getId(), "Выберете какую информацию Вы хотите получить ", false, null, null, $keyboard);

It's ok, so:

$art = array();
while ($row = $query->fetch_assoc()) {
	    	array_push($art,array(
	    				"text" => 	    			 $row["gorod"]));
			
	    	}
$keygorodart = new \TelegramBot\Api\Types\ReplyKeyboardMarkup	( $art, false,true );
  $bot->sendMessage($id, $oi, false, null, null, $keygorodart );

Not work, text $oi send in bot, Keyboard not update....$art is normal array (see print_r)

irinahart avatar Jun 24 '21 10:06 irinahart

@irinahart still facing this issue ?

bernard-ng avatar Dec 19 '22 01:12 bernard-ng