what are you mean? you want to change button size or you talk about Emoji?
if about resize, your function should look like this:
$reply_markup = array(
'keyboard' => array(['⬅️','Button','']),
'resize_keyboard' => true,
'selective' => true
);
var_dump(
makeHTTPRequest('sendMessage',[
'chat_id'=>userid,
'text'=>"Text",
'reply_markup'=>$reply_markup
])
);
you can use emoji as unicode, shortcode or copying raw image.
if you are using PHP, the simple way is to insert Unicode or UTF-8 characters in button text.
this link more usefull for PHP Emoji Table
also, you can find many different examples on github and others
for example, one of my first bot for pizza place :)
<?php
define('TOKEN', '<token>');
define('URL', 'https://api.telegram.org/bot'.TOKEN.'/');
$bot = json_decode(file_get_contents('php://input'), true);
$chat = $bot["message"]["chat"]["id"];
$user = $bot["message"]["chat"]["first_name"].' '.$bot["message"]["chat"]["last_name"];
$text = $bot["message"]["text"];
$menuMsg = "Hello, ${user}! Enjoy a new Banana Pie. \xF0\x9F\x8D\x8C \xF0\x9F\x98\x8A";
if ( $text == "/start" ){
$Menu = array(
array("\xF0\x9F\x8D\xB4 Menu", "\xF0\x9F\x92\xB0 Checkout"),
array("\xE2\x86\xAA Last oreder", "\xE2\x9D\x8C Cancel")
);
send_keyb(
$chat,
$menuMsg,
$Menu
);
}
function send_keyb( $chat, $msg, $keyb ){
$content = array(
'parse_mode' => 'HTML',
'chat_id' => $chat,
'text' => $msg,
'reply_markup' => keyboard($keyb)
);
curlGET(
URL."sendMessage?".http_build_query( $content )
);
}
function keyboard( $keyb ){
$reply = array(
'keyboard' => $keyb,
'one_time_keyboard' => true,
'resize_keyboard' => true,
'selective' => true
);
return json_encode( $reply, true );
}
function curlGET( $url ) {
$menuIthem = curl_init(
trim( $url )
);
curl_setopt(
$menuIthem,
CURLOPT_RETURNTRANSFER,
true
);
$res = explode(
"\nDATA=",
curl_exec(
$menuIthem
)
);
curl_close( $menuIthem );
return json_decode( $res[1], true );
}
?>