<?php
define('BOT_TOKEN', '');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
// Function to save user ID
function saveUser($user_id, $username) {
$file = 'users.txt';
$current = file_exists($file) ? file_get_contents($file) : '';
if (strpos($current, "$user_id") === false) {
file_put_contents($file, "$user_id|$username\n", FILE_APPEND);
}
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
// Function to get user count
function getUserCount() {
$file = 'users.txt';
if (!file_exists($file)) return 0;
return count(file($file));
}
function makeRequest($method, $params = []) {
$url = API_URL.$method;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode($params),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
]);
$response = curl_exec($curl);
curl_close($curl);
return json_decode($response, true);
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function sendMessage($chat_id, $text, $reply_markup = null) {
$params = [
'chat_id' => $chat_id,
'text' => $text,
'parse_mode' => 'HTML',
];
if ($reply_markup) {
$params['reply_markup'] = $reply_markup;
}
return makeRequest('sendMessage', $params);
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function updateProgressBar($chat_id, $message_id, $progress) {
$bars = [
"▱▱▱▱▱▱▱▱▱▱",
"▰▱▱▱▱▱▱▱▱▱",
"▰▰▱▱▱▱▱▱▱▱",
"▰▰▰▱▱▱▱▱▱▱",
"▰▰▰▰▱▱▱▱▱▱",
"▰▰▰▰▰▱▱▱▱▱",
"▰▰▰▰▰▰▱▱▱▱",
"▰▰▰▰▰▰▰▱▱▱",
"▰▰▰▰▰▰▰▰▱▱",
"▰▰▰▰▰▰▰▰▰▱",
"▰▰▰▰▰▰▰▰▰▰"
];
$progress_index = min(floor($progress / 10), 10);
$progress_bar = $bars[$progress_index];
$loading_message = "
╔═══════════════════╗
║
𝐒𝐜𝐚𝐧𝐧𝐢𝐧𝐠 𝐈𝐏... ║
╚═══════════════════╝
Progress: $progress_bar {$progress}%
Please wait...";
try {
makeRequest('editMessageText', [
'chat_id' => $chat_id,
'message_id' => $message_id,
'text' => $loading_message,
'parse_mode' => 'HTML'
]);
// Reduced delay
usleep(100000); // 0.1 seconds
} catch (Exception $e) {
// Silent fail for progress updates
}
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function checkIP($ip, $chat_id, $message_id) {
updateProgressBar($chat_id, $message_id, 10);
$ch = curl_init();
$url = "https://scamalytics.com/ip/{$ip}";
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
'Accept-Language: en-US,en;q=0.9',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
]
]);
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpcode != 200 || !$response) {
return [
'ip' => $ip,
'error' => true,
'message' => 'Failed to fetch data'
];
}
updateProgressBar($chat_id, $message_id, 50);
// Extract data from the response
try {
preg_match('/<pre[^>]*>(.*?)<\/pre>/s', $response, $json_match);
$json_data = json_decode(trim($json_match[1]), true) ?? [];
$data = [
'ip' => $ip,
'score' => $json_data['score'] ?? 'N/A',
'risk' => $json_data['risk'] ?? 'N/A',
'hostname' => extractValue($response, 'Hostname'),
'asn' => extractValue($response, 'ASN'),
'isp' => extractValue($response, 'ISP Name'),
'organization' => extractValue($response, 'Organization Name'),
'connection_type' => extractValue($response, 'Connection type'),
'country' => extractValue($response, 'Country Name'),
'country_code' => extractValue($response, 'Country Code'),
'state' => extractValue($response, 'State / Province'),
'district' => extractValue($response, 'District / County'),
'city' => extractValue($response, 'City'),
'postal' => extractValue($response, 'Postal Code'),
'latitude' => extractValue($response, 'Latitude'),
'longitude' => extractValue($response, 'Longitude'),
'datacenter' => extractValue($response, 'Datacenter'),
'vpn' => extractValue($response, 'Anonymizing VPN'),
'tor' => extractValue($response, 'Tor Exit Node'),
'server' => extractValue($response, 'Server'),
'proxy' => extractValue($response, 'Public Proxy'),
'web_proxy' => extractValue($response, 'Web Proxy'),
'search_engine' => extractValue($response, 'Search Engine Robot')
];
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
updateProgressBar($chat_id, $message_id, 100);
return $data;
} catch (Exception $e) {
return [
'ip' => $ip,
'error' => true,
'message' => 'Error parsing data'
];
}
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function extractValue($html, $field) {
$pattern = '/<th>' . preg_quote($field, '/') . '<\/th>\s*<td[^>]*>(.*?)<\/td>/si';
if (preg_match($pattern, $html, $matches)) {
$value = strip_tags($matches[1]);
return trim($value) ?: 'N/A';
}
return 'N/A';
}
function extractFromTable($html, $field) {
$pattern = '/<th>' . preg_quote($field, '/') . '<\/th>\s*<td.*?>(.*?)<\/td>/si';
if (preg_match($pattern, $html, $matches)) {
$value = strip_tags($matches[1]);
return trim($value) !== '' ? trim($value) : 'N/A';
}
return 'N/A';
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function extractRiskValue($html, $field) {
$pattern = '/<th>' . preg_quote($field, '/') . '<\/th>\s*<td.*?<div class="risk.*?">(.*?)<\/div>/si';
if (preg_match($pattern, $html, $matches)) {
return trim(strip_tags($matches[1]));
}
return 'N/A';
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function formatValue($value) {
return (empty($value) || $value == 'n/a' || $value == 'N/A') ? '𝗡/𝗔' : $value;
}
$update = json_decode(file_get_contents('php://input'), true);
$message = $update['message'] ?? null;
if ($message) {
$chat_id = $message['chat']['id'];
$text = $message['text'] ?? '';
if ($text === '/start') {
$user_id = $message['from']['id'];
$username = $message['from']['username'] ?? 'NoUsername';
$first_name = $message['from']['first_name'] ?? 'Unknown';
// Save user
saveUser($user_id, $username);
$total_users = getUserCount();
$welcome_message = "
╔══════════════════╗
║
𝐈𝐏 𝐂𝐡𝐞𝐜𝐤𝐞𝐫 𝐁𝐨𝐭
║
╚══════════════════╝
Welcome to the Advanced IP Checker!
User: @$username
𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀:
╔═══════════════════
║
️ /ip <code>ip_address</code>
╚═══════════════════
𝗘𝘅𝗮𝗺𝗽𝗹𝗲: /ip 8.8.8.8
━━━━━━━━━━━━━━━━━━";
$keyboard = [
'inline_keyboard' => [
[
['text' => '𝘾𝙝𝙖𝙣𝙣𝙚𝙡', 'url' => 't.me/Kamal_Dev_o1'],
['text' => '𝘿𝙚𝙫', 'url' => 't.me/Mod_By_Kamal']
],
[
['text' => '𝙎𝙝𝙖𝙧𝙚 𝘽𝙤𝙩', 'url' => 'https://t.me/share/url?url=t.me/FraudRiskCheckBot']
]
]
];
sendMessage($chat_id, $welcome_message, json_encode($keyboard));
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
elseif (strpos($text, '/ip') === 0 || strpos($text, '.ip') === 0) {
$ip = trim(str_replace(['/ip', '.ip'], '', $text));
if (empty($ip) || !filter_var($ip, FILTER_VALIDATE_IP)) {
sendMessage($chat_id, "
𝗘𝗿𝗿𝗼𝗿: Please provide a valid IP address!\n\n
𝗘𝘅𝗮𝗺𝗽𝗹𝗲: /ip 8.8.8.8");
exit;
}
// Send initial loading message
$loading_msg = sendMessage($chat_id, "
╔═══════════════════╗
║
𝐒𝐜𝐚𝐧𝐧𝐢𝐧𝐠 𝐈𝐏... ║
╚═══════════════════╝
Progress: ▱▱▱▱▱▱▱▱▱▱ 0%
Please wait...");
if (!isset($loading_msg['result']['message_id'])) {
sendMessage($chat_id, "
Error: Failed to initialize check. Please try again.");
exit;
}
$message_id = $loading_msg['result']['message_id'];
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
// Check IP with progress updates
$ip_info = checkIP($ip, $chat_id, $message_id);
if (isset($ip_info['error'])) {
makeRequest('deleteMessage', ['chat_id' => $chat_id, 'message_id' => $message_id]);
sendMessage($chat_id, "
Error: {$ip_info['message']}\n\nPlease try again later.");
exit;
}
$risk_emoji = match(strtolower($ip_info['risk'])) {
'high' => '
',
'medium' => '
',
'low' => '
',
default => '
️'
};
$result_message = "
╔════════════════════╗
║
𝐈𝐏 𝐀𝐧𝐚𝐥𝐲𝐭𝐢𝐜𝐬 𝐑𝐞𝐩𝐨𝐫𝐭 ║
╚════════════════════╝
𝗜𝗣 𝗔𝗱𝗱𝗿𝗲𝘀𝘀: <code>{$ip}</code>
𝗥𝗶𝘀𝗸 𝗔𝗻𝗮𝗹𝘆𝘀𝗶𝘀:
┣ 𝗦𝗰𝗼𝗿𝗲: <code>".formatValue($ip_info['score'])."</code>
┗ 𝗥𝗶𝘀𝗸: $risk_emoji <code>".formatValue($ip_info['risk'])."</code>
𝗡𝗲𝘁𝘄𝗼𝗿𝗸 𝗗𝗲𝘁𝗮𝗶𝗹𝘀:
┣ 𝗛𝗼𝘀𝘁𝗻𝗮𝗺𝗲: <code>".formatValue($ip_info['hostname'])."</code>
┣ 𝗔𝗦𝗡: <code>".formatValue($ip_info['asn'])."</code>
┣ 𝗜𝗦𝗣: <code>".formatValue($ip_info['isp'])."</code>
┣ 𝗢𝗿𝗴𝗮𝗻𝗶𝘇𝗮𝘁𝗶𝗼𝗻: <code>".formatValue($ip_info['organization'])."</code>
┗ 𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝗼𝗻: <code>".formatValue($ip_info['connection_type'])."</code>
𝗟𝗼𝗰𝗮𝘁𝗶𝗼𝗻:
┣ 𝗖𝗼𝘂𝗻𝘁𝗿𝘆: <code>".formatValue($ip_info['country'])."</code> (<code>".formatValue($ip_info['country_code'])."</code>)
┣ 𝗦𝘁𝗮𝘁𝗲: <code>".formatValue($ip_info['state'])."</code>
┣ 𝗗𝗶𝘀𝘁𝗿𝗶𝗰𝘁: <code>".formatValue($ip_info['district'])."</code>
┣ 𝗖𝗶𝘁𝘆: <code>".formatValue($ip_info['city'])."</code>
┣ 𝗣𝗼𝘀𝘁𝗮𝗹 𝗖𝗼𝗱𝗲: <code>".formatValue($ip_info['postal'])."</code>
┣ 𝗟𝗮𝘁𝗶𝘁𝘂𝗱𝗲: <code>".formatValue($ip_info['latitude'])."</code>
┗ 𝗟𝗼𝗻𝗴𝗶𝘁𝘂𝗱𝗲: <code>".formatValue($ip_info['longitude'])."</code>
𝗦𝗲𝗰𝘂𝗿𝗶𝘁𝘆 𝗖𝗵𝗲𝗰𝗸𝘀:
┣ 𝗗𝗮𝘁𝗮𝗰𝗲𝗻𝘁𝗲𝗿: <code>".formatValue($ip_info['datacenter'])."</code>
┣ 𝗩𝗣𝗡: <code>".formatValue($ip_info['vpn'])."</code>
┣ 𝗧𝗼𝗿: <code>".formatValue($ip_info['tor'])."</code>
┣ 𝗦𝗲𝗿𝘃𝗲𝗿: <code>".formatValue($ip_info['server'])."</code>
┣ 𝗣𝗿𝗼𝘅𝘆: <code>".formatValue($ip_info['proxy'])."</code>
┣ 𝗪𝗲𝗯 𝗣𝗿𝗼𝘅𝘆: <code>".formatValue($ip_info['web_proxy'])."</code>
┗ 𝗦𝗲𝗮𝗿𝗰𝗵 𝗘𝗻𝗴𝗶𝗻𝗲: <code>".formatValue($ip_info['search_engine'])."</code>
𝗖𝗵𝗲𝗰𝗸𝗲𝗱 𝗕𝘆: @".$message['from']['username']."
━━━━━━━━━━━━━━━
@FraudRiskCheckBot";
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
// Try to edit the loading message instead of deleting and sending new one
$edit_result = makeRequest('editMessageText', [
'chat_id' => $chat_id,
'message_id' => $message_id,
'text' => $result_message,
'parse_mode' => 'HTML',
'disable_web_page_preview' => true
]);
// If editing fails, delete and send new message
if (!isset($edit_result['ok']) || !$edit_result['ok']) {
makeRequest('deleteMessage', ['chat_id' => $chat_id, 'message_id' => $message_id]);
sendMessage($chat_id, $result_message);
}
}
}
?>
define('BOT_TOKEN', '');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
// Function to save user ID
function saveUser($user_id, $username) {
$file = 'users.txt';
$current = file_exists($file) ? file_get_contents($file) : '';
if (strpos($current, "$user_id") === false) {
file_put_contents($file, "$user_id|$username\n", FILE_APPEND);
}
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
// Function to get user count
function getUserCount() {
$file = 'users.txt';
if (!file_exists($file)) return 0;
return count(file($file));
}
function makeRequest($method, $params = []) {
$url = API_URL.$method;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode($params),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
]);
$response = curl_exec($curl);
curl_close($curl);
return json_decode($response, true);
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function sendMessage($chat_id, $text, $reply_markup = null) {
$params = [
'chat_id' => $chat_id,
'text' => $text,
'parse_mode' => 'HTML',
];
if ($reply_markup) {
$params['reply_markup'] = $reply_markup;
}
return makeRequest('sendMessage', $params);
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function updateProgressBar($chat_id, $message_id, $progress) {
$bars = [
"▱▱▱▱▱▱▱▱▱▱",
"▰▱▱▱▱▱▱▱▱▱",
"▰▰▱▱▱▱▱▱▱▱",
"▰▰▰▱▱▱▱▱▱▱",
"▰▰▰▰▱▱▱▱▱▱",
"▰▰▰▰▰▱▱▱▱▱",
"▰▰▰▰▰▰▱▱▱▱",
"▰▰▰▰▰▰▰▱▱▱",
"▰▰▰▰▰▰▰▰▱▱",
"▰▰▰▰▰▰▰▰▰▱",
"▰▰▰▰▰▰▰▰▰▰"
];
$progress_index = min(floor($progress / 10), 10);
$progress_bar = $bars[$progress_index];
$loading_message = "
╔═══════════════════╗
║
╚═══════════════════╝
try {
makeRequest('editMessageText', [
'chat_id' => $chat_id,
'message_id' => $message_id,
'text' => $loading_message,
'parse_mode' => 'HTML'
]);
// Reduced delay
usleep(100000); // 0.1 seconds
} catch (Exception $e) {
// Silent fail for progress updates
}
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function checkIP($ip, $chat_id, $message_id) {
updateProgressBar($chat_id, $message_id, 10);
$ch = curl_init();
$url = "https://scamalytics.com/ip/{$ip}";
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8',
'Accept-Language: en-US,en;q=0.9',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
]
]);
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpcode != 200 || !$response) {
return [
'ip' => $ip,
'error' => true,
'message' => 'Failed to fetch data'
];
}
updateProgressBar($chat_id, $message_id, 50);
// Extract data from the response
try {
preg_match('/<pre[^>]*>(.*?)<\/pre>/s', $response, $json_match);
$json_data = json_decode(trim($json_match[1]), true) ?? [];
$data = [
'ip' => $ip,
'score' => $json_data['score'] ?? 'N/A',
'risk' => $json_data['risk'] ?? 'N/A',
'hostname' => extractValue($response, 'Hostname'),
'asn' => extractValue($response, 'ASN'),
'isp' => extractValue($response, 'ISP Name'),
'organization' => extractValue($response, 'Organization Name'),
'connection_type' => extractValue($response, 'Connection type'),
'country' => extractValue($response, 'Country Name'),
'country_code' => extractValue($response, 'Country Code'),
'state' => extractValue($response, 'State / Province'),
'district' => extractValue($response, 'District / County'),
'city' => extractValue($response, 'City'),
'postal' => extractValue($response, 'Postal Code'),
'latitude' => extractValue($response, 'Latitude'),
'longitude' => extractValue($response, 'Longitude'),
'datacenter' => extractValue($response, 'Datacenter'),
'vpn' => extractValue($response, 'Anonymizing VPN'),
'tor' => extractValue($response, 'Tor Exit Node'),
'server' => extractValue($response, 'Server'),
'proxy' => extractValue($response, 'Public Proxy'),
'web_proxy' => extractValue($response, 'Web Proxy'),
'search_engine' => extractValue($response, 'Search Engine Robot')
];
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
updateProgressBar($chat_id, $message_id, 100);
return $data;
} catch (Exception $e) {
return [
'ip' => $ip,
'error' => true,
'message' => 'Error parsing data'
];
}
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function extractValue($html, $field) {
$pattern = '/<th>' . preg_quote($field, '/') . '<\/th>\s*<td[^>]*>(.*?)<\/td>/si';
if (preg_match($pattern, $html, $matches)) {
$value = strip_tags($matches[1]);
return trim($value) ?: 'N/A';
}
return 'N/A';
}
function extractFromTable($html, $field) {
$pattern = '/<th>' . preg_quote($field, '/') . '<\/th>\s*<td.*?>(.*?)<\/td>/si';
if (preg_match($pattern, $html, $matches)) {
$value = strip_tags($matches[1]);
return trim($value) !== '' ? trim($value) : 'N/A';
}
return 'N/A';
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function extractRiskValue($html, $field) {
$pattern = '/<th>' . preg_quote($field, '/') . '<\/th>\s*<td.*?<div class="risk.*?">(.*?)<\/div>/si';
if (preg_match($pattern, $html, $matches)) {
return trim(strip_tags($matches[1]));
}
return 'N/A';
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
function formatValue($value) {
return (empty($value) || $value == 'n/a' || $value == 'N/A') ? '𝗡/𝗔' : $value;
}
$update = json_decode(file_get_contents('php://input'), true);
$message = $update['message'] ?? null;
if ($message) {
$chat_id = $message['chat']['id'];
$text = $message['text'] ?? '';
if ($text === '/start') {
$user_id = $message['from']['id'];
$username = $message['from']['username'] ?? 'NoUsername';
$first_name = $message['from']['first_name'] ?? 'Unknown';
// Save user
saveUser($user_id, $username);
$total_users = getUserCount();
$welcome_message = "
╔══════════════════╗
║
╚══════════════════╝
Welcome to the Advanced IP Checker!
╔═══════════════════
║
╚═══════════════════
━━━━━━━━━━━━━━━━━━";
$keyboard = [
'inline_keyboard' => [
[
['text' => '𝘾𝙝𝙖𝙣𝙣𝙚𝙡', 'url' => 't.me/Kamal_Dev_o1'],
['text' => '𝘿𝙚𝙫', 'url' => 't.me/Mod_By_Kamal']
],
[
['text' => '𝙎𝙝𝙖𝙧𝙚 𝘽𝙤𝙩', 'url' => 'https://t.me/share/url?url=t.me/FraudRiskCheckBot']
]
]
];
sendMessage($chat_id, $welcome_message, json_encode($keyboard));
}
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
elseif (strpos($text, '/ip') === 0 || strpos($text, '.ip') === 0) {
$ip = trim(str_replace(['/ip', '.ip'], '', $text));
if (empty($ip) || !filter_var($ip, FILTER_VALIDATE_IP)) {
sendMessage($chat_id, "
exit;
}
// Send initial loading message
$loading_msg = sendMessage($chat_id, "
╔═══════════════════╗
║
╚═══════════════════╝
if (!isset($loading_msg['result']['message_id'])) {
sendMessage($chat_id, "
exit;
}
$message_id = $loading_msg['result']['message_id'];
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
// Check IP with progress updates
$ip_info = checkIP($ip, $chat_id, $message_id);
if (isset($ip_info['error'])) {
makeRequest('deleteMessage', ['chat_id' => $chat_id, 'message_id' => $message_id]);
sendMessage($chat_id, "
exit;
}
$risk_emoji = match(strtolower($ip_info['risk'])) {
'high' => '
'medium' => '
'low' => '
default => '
};
$result_message = "
╔════════════════════╗
║
╚════════════════════╝
┣ 𝗦𝗰𝗼𝗿𝗲: <code>".formatValue($ip_info['score'])."</code>
┗ 𝗥𝗶𝘀𝗸: $risk_emoji <code>".formatValue($ip_info['risk'])."</code>
┣ 𝗛𝗼𝘀𝘁𝗻𝗮𝗺𝗲: <code>".formatValue($ip_info['hostname'])."</code>
┣ 𝗔𝗦𝗡: <code>".formatValue($ip_info['asn'])."</code>
┣ 𝗜𝗦𝗣: <code>".formatValue($ip_info['isp'])."</code>
┣ 𝗢𝗿𝗴𝗮𝗻𝗶𝘇𝗮𝘁𝗶𝗼𝗻: <code>".formatValue($ip_info['organization'])."</code>
┗ 𝗖𝗼𝗻𝗻𝗲𝗰𝘁𝗶𝗼𝗻: <code>".formatValue($ip_info['connection_type'])."</code>
┣ 𝗖𝗼𝘂𝗻𝘁𝗿𝘆: <code>".formatValue($ip_info['country'])."</code> (<code>".formatValue($ip_info['country_code'])."</code>)
┣ 𝗦𝘁𝗮𝘁𝗲: <code>".formatValue($ip_info['state'])."</code>
┣ 𝗗𝗶𝘀𝘁𝗿𝗶𝗰𝘁: <code>".formatValue($ip_info['district'])."</code>
┣ 𝗖𝗶𝘁𝘆: <code>".formatValue($ip_info['city'])."</code>
┣ 𝗣𝗼𝘀𝘁𝗮𝗹 𝗖𝗼𝗱𝗲: <code>".formatValue($ip_info['postal'])."</code>
┣ 𝗟𝗮𝘁𝗶𝘁𝘂𝗱𝗲: <code>".formatValue($ip_info['latitude'])."</code>
┗ 𝗟𝗼𝗻𝗴𝗶𝘁𝘂𝗱𝗲: <code>".formatValue($ip_info['longitude'])."</code>
┣ 𝗗𝗮𝘁𝗮𝗰𝗲𝗻𝘁𝗲𝗿: <code>".formatValue($ip_info['datacenter'])."</code>
┣ 𝗩𝗣𝗡: <code>".formatValue($ip_info['vpn'])."</code>
┣ 𝗧𝗼𝗿: <code>".formatValue($ip_info['tor'])."</code>
┣ 𝗦𝗲𝗿𝘃𝗲𝗿: <code>".formatValue($ip_info['server'])."</code>
┣ 𝗣𝗿𝗼𝘅𝘆: <code>".formatValue($ip_info['proxy'])."</code>
┣ 𝗪𝗲𝗯 𝗣𝗿𝗼𝘅𝘆: <code>".formatValue($ip_info['web_proxy'])."</code>
┗ 𝗦𝗲𝗮𝗿𝗰𝗵 𝗘𝗻𝗴𝗶𝗻𝗲: <code>".formatValue($ip_info['search_engine'])."</code>
━━━━━━━━━━━━━━━
// @𝙈𝙤𝙙_𝘽𝙮_𝙆𝙖𝙢𝙖𝙡
// Try to edit the loading message instead of deleting and sending new one
$edit_result = makeRequest('editMessageText', [
'chat_id' => $chat_id,
'message_id' => $message_id,
'text' => $result_message,
'parse_mode' => 'HTML',
'disable_web_page_preview' => true
]);
// If editing fails, delete and send new message
if (!isset($edit_result['ok']) || !$edit_result['ok']) {
makeRequest('deleteMessage', ['chat_id' => $chat_id, 'message_id' => $message_id]);
sendMessage($chat_id, $result_message);
}
}
}
?>