   /*
/////////////////////////////////////////
if ($text == '/qr2' && $count1 == 1) {
///////////////////////////////////
    include "phpqrcode/qrlib.php"; 

    // nama folder tempat penyimpanan file qrcode
    $penyimpanan = "temp/";

    // membuat folder dengan nama "temp"
    if (!file_exists($penyimpanan))
    mkdir($penyimpanan);

    $filepath = 'temp/'.$chat_id.'.png'';
$filelog = 'logo/'.$chat_id.'.png'';

// Image (logo) to be drawn
$logopath = 'https://isekolah.my.id/esp32_restapi/logo_2.png';
// qr code content
//$codeContents = 'http://ourcodeworld.com';
$codeContents = $res3;
// Create the file in the providen path
// Customize how you want
QRcode::png($codeContents,$filepath , QR_ECLEVEL_H, 20);

// Start DRAWING LOGO IN QRCODE

$QR = imagecreatefrompng($filepath);

// START TO DRAW THE IMAGE ON THE QR CODE
$logo = imagecreatefromstring(file_get_contents($logopath));

/**
 *  Fix for the transparent background
 */
imagecolortransparent($logo , imagecolorallocatealpha($logo , 0, 0, 0, 127));
imagealphablending($logo , false);
imagesavealpha($logo , true);

$QR_width = imagesx($QR);
$QR_height = imagesy($QR);

$logo_width = imagesx($logo);
$logo_height = imagesy($logo);

// Scale logo to fit in the QR Code
$logo_qr_width = $QR_width/3;
$scale = $logo_width/$logo_qr_width;
$logo_qr_height = $logo_height/$scale;

imagecopyresampled($QR, $logo, $QR_width/3, $QR_height/3, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);

// Save QR code again, but with logo on it
imagepng($QR,$filelog);

   
     sendMessage($chat_id, "qr code telah sukses dibuat");
    }

     $pecah = (explode(',',$text));
     $txt0= $pecah['0'];
     $txt1= $pecah['1'];
     $txt2= $pecah['2'];
     //sendMessage($chat_id, $txt0."&".$txt1."&".$txt2);
*/
