├── README.md └── index.php /README.md: -------------------------------------------------------------------------------- 1 | # Chat ID Echo Bot (PHP) 2 | 3 | ![Chat ID Echo Bot](https://img.shields.io/badge/Telegram-Bot-blue?logo=telegram) 4 | A lightweight Telegram bot written in PHP to fetch chat IDs for users, groups, channels, and bots with ease. 5 | 6 | ## 📖 Overview 7 | 8 | The **Chat ID Echo Bot (PHP)** is a Telegram bot designed to retrieve the unique IDs of Telegram entities (users, groups, channels, and bots) using a simple keyboard interface. Built with PHP and leveraging the Telegram Bot API, this bot is perfect for developers needing chat IDs for API interactions or users managing Telegram groups and channels. 9 | 10 | This project is maintained by [abirxdhack](https://github.com/abirxdhack) and hosted at [Chat-ID-Echo-Bot](https://github.com/abirxdhack/Chat-ID-Echo-Bot). 11 | 12 | ## ✨ Features 13 | 14 | - **Fetch Chat IDs Instantly**: Get IDs for users, bots, private/public groups, and private/public channels. 15 | - **Interactive Keyboard**: User-friendly buttons to share Telegram entities. 16 | - **Lightweight and Fast**: Minimal PHP script with no external dependencies. 17 | - **Customizable**: Easily modify the keyboard layout and messages to suit your needs. 18 | - **Open Source**: Contribute or adapt the bot for your own projects! 19 | 20 | ## 📋 Prerequisites 21 | 22 | Before setting up the bot, ensure you have the following: 23 | 24 | - **PHP 7.0+**: The bot is written in PHP. 25 | - **Web Server**: A server with PHP support (e.g., Apache, Nginx) to host the bot script. 26 | - **HTTPS URL**: Telegram webhooks require a secure HTTPS URL. 27 | - **Bot Token**: Create a bot via [BotFather](https://t.me/BotFather) on Telegram to get a `BOT_TOKEN`. 28 | 29 | ## 🛠 Installation 30 | 31 | 1. **Clone the Repository**: 32 | ```bash 33 | git clone https://github.com/abirxdhack/Chat-ID-Echo-Bot.git 34 | cd Chat-ID-Echo-Bot 35 | ``` 36 | 37 | 2. **Set Up Your Bot Token**: 38 | Open `index.php` (or rename the script as needed) and replace the placeholder token with your bot token: 39 | ```php 40 | $BOT_TOKEN = "YOUR_BOT_TOKEN_HERE"; // Replace with your Bot Token 41 | ``` 42 | 43 | 3. **Host the Script**: 44 | - Upload the PHP script (e.g., `index.php`) to your web server. 45 | - Ensure the script is accessible via an HTTPS URL (e.g., `https://yourdomain.com/index.php`). 46 | 47 | 4. **Set Up the Webhook**: 48 | Use the Telegram Bot API to set the webhook for your bot: 49 | - Open your browser or use a tool like `curl` to make the following request: 50 | ``` 51 | https://api.telegram.org/botYOUR_BOT_TOKEN_HERE/setWebhook?url=https://yourdomain.com/index.php 52 | ``` 53 | - Replace `YOUR_BOT_TOKEN_HERE` with your bot token and `https://yourdomain.com/index.php` with the URL of your script. 54 | - If successful, you’ll get a response like: `{"ok":true,"result":true,"description":"Webhook was set"}`. 55 | 56 | ## 🚀 Usage 57 | 58 | 1. **Start the Bot**: 59 | - Open Telegram and start a chat with your bot (find it using the username you set via BotFather). 60 | - Send the `/start` command to see the welcome message and keyboard. 61 | 62 | 2. **Fetch Chat IDs**: 63 | - Click a button (e.g., "👤 User", "🔒 Private Group", or "🌐 Public Channel") and share the requested entity. 64 | - The bot will reply with the chat ID, e.g.: 65 | ``` 66 | 👤 Shared User Info 67 | 🆔 ID: 5857628904 68 | ``` 69 | 70 | ## 📜 Code Structure 71 | 72 | - **`index.php`**: The main PHP script that handles Telegram updates, processes user input, and sends responses with chat IDs. 73 | - **Keyboard Layout**: Customizable keyboard with buttons for sharing users, groups, channels, and bots. 74 | 75 | ## 🤝 Contributing 76 | 77 | Contributions are welcome! If you have ideas for new features or improvements, feel free to: 78 | 79 | 1. Fork the repository. 80 | 2. Create a new branch (`git checkout -b feature/your-feature`). 81 | 3. Make your changes and commit them (`git commit -m 'Add your feature'`). 82 | 4. Push to the branch (`git push origin feature/your-feature`). 83 | 5. Open a pull request. 84 | 85 | ## 📄 License 86 | 87 | This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. 88 | 89 | ## 📧 Contact 90 | 91 | For questions, suggestions, or support, reach out to [abirxdhack](https://github.com/abirxdhack) via GitHub Issues or Telegram (@TheSmartDev). 92 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | $chat_id, 29 | 'text' => $text, 30 | 'parse_mode' => 'HTML' 31 | ]; 32 | if ($keyboard) { 33 | $payload['reply_markup'] = json_encode($keyboard); 34 | } 35 | if ($disable_link_preview) { 36 | $payload['disable_web_page_preview'] = true; 37 | } 38 | 39 | $options = [ 40 | 'http' => [ 41 | 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 42 | 'method' => 'POST', 43 | 'content' => http_build_query($payload) 44 | ] 45 | ]; 46 | $context = stream_context_create($options); 47 | $response = @file_get_contents($url, false, $context); 48 | 49 | if ($response === false) { 50 | logError("Failed to send message to chat_id $chat_id"); 51 | return false; 52 | } 53 | $result = json_decode($response, true); 54 | if (!$result['ok']) { 55 | logError("Telegram API error for chat_id $chat_id: " . json_encode($result)); 56 | return false; 57 | } 58 | logInfo("Successfully sent message to chat_id $chat_id"); 59 | return true; 60 | } 61 | 62 | function sendPhoto($token, $chat_id, $photo, $caption, $keyboard = null) { 63 | $url = "https://api.telegram.org/bot$token/sendPhoto"; 64 | $payload = [ 65 | 'chat_id' => $chat_id, 66 | 'photo' => $photo, 67 | 'caption' => $caption, 68 | 'parse_mode' => 'HTML' 69 | ]; 70 | if ($keyboard) { 71 | $payload['reply_markup'] = json_encode($keyboard); 72 | } 73 | 74 | $options = [ 75 | 'http' => [ 76 | 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 77 | 'method' => 'POST', 78 | 'content' => http_build_query($payload) 79 | ] 80 | ]; 81 | $context = stream_context_create($options); 82 | $response = @file_get_contents($url, false, $context); 83 | 84 | if ($response === false) { 85 | logError("Failed to send photo to chat_id $chat_id"); 86 | return false; 87 | } 88 | $result = json_decode($response, true); 89 | if (!$result['ok']) { 90 | logError("Telegram API error when sending photo to chat_id $chat_id: " . json_encode($result)); 91 | return false; 92 | } 93 | logInfo("Successfully sent photo to chat_id $chat_id"); 94 | return true; 95 | } 96 | 97 | $menu_buttons = [ 98 | 'keyboard' => [ 99 | [ 100 | [ 101 | 'text' => '👤 User Info', 102 | 'request_users' => [ 103 | 'request_id' => 1, 104 | 'user_is_bot' => false, 105 | 'max_quantity' => 1, 106 | 'request_name' => true, 107 | 'request_username' => true, 108 | 'request_photo' => true 109 | ] 110 | ] 111 | ], 112 | [ 113 | [ 114 | 'text' => '👥 Public Group', 115 | 'request_chat' => [ 116 | 'request_id' => 7, 117 | 'chat_is_channel' => false, 118 | 'chat_has_username' => true, 119 | 'request_title' => true, 120 | 'request_username' => true, 121 | 'request_photo' => true 122 | ] 123 | ], 124 | [ 125 | 'text' => '🔒 Private Group', 126 | 'request_chat' => [ 127 | 'request_id' => 6, 128 | 'chat_is_channel' => false, 129 | 'chat_has_username' => false, 130 | 'request_title' => true, 131 | 'request_username' => true, 132 | 'request_photo' => true 133 | ] 134 | ] 135 | ], 136 | [ 137 | [ 138 | 'text' => '📢 Public Channel', 139 | 'request_chat' => [ 140 | 'request_id' => 5, 141 | 'chat_is_channel' => true, 142 | 'chat_has_username' => true, 143 | 'request_title' => true, 144 | 'request_username' => true, 145 | 'request_photo' => true 146 | ] 147 | ], 148 | [ 149 | 'text' => '🔒 Private Channel', 150 | 'request_chat' => [ 151 | 'request_id' => 4, 152 | 'chat_is_channel' => true, 153 | 'chat_has_username' => false, 154 | 'request_title' => true, 155 | 'request_username' => true, 156 | 'request_photo' => true 157 | ] 158 | ] 159 | ], 160 | [ 161 | [ 162 | 'text' => '🤖 Bot', 163 | 'request_users' => [ 164 | 'request_id' => 2, 165 | 'user_is_bot' => true, 166 | 'max_quantity' => 1, 167 | 'request_name' => true, 168 | 'request_username' => true, 169 | 'request_photo' => true 170 | ] 171 | ], 172 | [ 173 | 'text' => '🌟 Premium Users', 174 | 'request_users' => [ 175 | 'request_id' => 3, 176 | 'user_is_premium' => true, 177 | 'max_quantity' => 1, 178 | 'request_name' => true, 179 | 'request_username' => true, 180 | 'request_photo' => true 181 | ] 182 | ] 183 | ], 184 | [ 185 | ['text' => '👥 Admins Chat'], 186 | ['text' => '👑 Owner Chat'] 187 | ] 188 | ], 189 | 'resize_keyboard' => true, 190 | 'input_field_placeholder' => 'Choose a chat type' 191 | ]; 192 | 193 | $my_buttons = [ 194 | 'keyboard' => [ 195 | [ 196 | [ 197 | 'text' => '📢 Your Channel', 198 | 'request_chat' => [ 199 | 'request_id' => 9, 200 | 'chat_is_channel' => true, 201 | 'user_admin_rights' => [ 202 | 'can_manage_chat' => true, 203 | 'can_delete_messages' => true, 204 | 'can_manage_video_chats' => true, 205 | 'can_restrict_members' => true, 206 | 'can_promote_members' => true, 207 | 'can_change_info' => true, 208 | 'can_post_messages' => true, 209 | 'can_edit_messages' => true, 210 | 'can_invite_users' => true, 211 | 'can_pin_messages' => true, 212 | 'can_manage_topics' => true, 213 | 'can_post_stories' => true, 214 | 'can_edit_stories' => true, 215 | 'can_delete_stories' => true 216 | ], 217 | 'request_title' => true, 218 | 'request_username' => true, 219 | 'request_photo' => true 220 | ] 221 | ], 222 | [ 223 | 'text' => '👥 Your Group', 224 | 'request_chat' => [ 225 | 'request_id' => 8, 226 | 'chat_is_channel' => false, 227 | 'user_admin_rights' => [ 228 | 'can_manage_chat' => true, 229 | 'can_delete_messages' => true, 230 | 'can_manage_video_chats' => true, 231 | 'can_restrict_members' => true, 232 | 'can_promote_members' => true, 233 | 'can_change_info' => true, 234 | 'can_invite_users' => true, 235 | 'can_pin_messages' => true, 236 | 'can_manage_topics' => true 237 | ], 238 | 'request_title' => true, 239 | 'request_username' => true, 240 | 'request_photo' => true 241 | ] 242 | ] 243 | ], 244 | [ 245 | ['text' => '🔙 Back'] 246 | ] 247 | ], 248 | 'resize_keyboard' => true, 249 | 'input_field_placeholder' => 'Choose a own chat type' 250 | ]; 251 | 252 | $admin_buttons = [ 253 | 'keyboard' => [ 254 | [ 255 | [ 256 | 'text' => '📢 Channels', 257 | 'request_chat' => [ 258 | 'request_id' => 10, 259 | 'chat_is_channel' => true, 260 | 'user_admin_rights' => [ 261 | 'can_manage_chat' => true, 262 | 'can_delete_messages' => true, 263 | 'can_manage_video_chats' => true, 264 | 'can_restrict_members' => true, 265 | 'can_promote_members' => true, 266 | 'can_change_info' => true, 267 | 'can_post_messages' => true, 268 | 'can_edit_messages' => true, 269 | 'can_invite_users' => true, 270 | 'can_pin_messages' => true, 271 | 'can_manage_topics' => true, 272 | 'can_post_stories' => true, 273 | 'can_edit_stories' => true, 274 | 'can_delete_stories' => true 275 | ], 276 | 'request_title' => true, 277 | 'request_username' => true, 278 | 'request_photo' => true 279 | ] 280 | ], 281 | [ 282 | 'text' => '👥 Groups', 283 | 'request_chat' => [ 284 | 'request_id' => 11, 285 | 'chat_is_channel' => false, 286 | 'user_admin_rights' => [ 287 | 'can_manage_chat' => true, 288 | 'can_delete_messages' => true, 289 | 'can_manage_video_chats' => true, 290 | 'can_restrict_members' => true, 291 | 'can_promote_members' => true, 292 | 'can_change_info' => true, 293 | 'can_invite_users' => true, 294 | 'can_pin_messages' => true, 295 | 'can_manage_topics' => true 296 | ], 297 | 'request_title' => true, 298 | 'request_username' => true, 299 | 'request_photo' => true 300 | ] 301 | ] 302 | ], 303 | [ 304 | ['text' => '🔙 Back'] 305 | ] 306 | ], 307 | 'resize_keyboard' => true, 308 | 'input_field_placeholder' => 'Choose a admin chat type' 309 | ]; 310 | 311 | $types = [ 312 | 1 => ['name' => 'User'], 313 | 2 => ['name' => 'Bot'], 314 | 3 => ['name' => 'Premium User'], 315 | 4 => ['name' => 'Private Channel'], 316 | 5 => ['name' => 'Public Channel'], 317 | 6 => ['name' => 'Private Group'], 318 | 7 => ['name' => 'Public Group'], 319 | 8 => ['name' => 'Your Group'], 320 | 9 => ['name' => 'Your Channel'], 321 | 10 => ['name' => 'Admin Channel'], 322 | 11 => ['name' => 'Admin Group'] 323 | ]; 324 | 325 | $content = file_get_contents("php://input"); 326 | $update = json_decode($content, true); 327 | 328 | if (!$update || !isset($update['message'])) { 329 | logError("No valid update or message received"); 330 | exit; 331 | } 332 | 333 | logInfo("Received update: " . json_encode($update)); 334 | 335 | $message = $update['message']; 336 | $chat_id = $message['chat']['id']; 337 | $text = $message['text'] ?? ''; 338 | 339 | if ($text === '/start') { 340 | logInfo("Handling /start command for chat_id: $chat_id"); 341 | $reply_text = "👋 Welcome to Chat ID Finder Bot! 🆔\n\n" . 342 | "✅ Fetch Any Chat ID Instantly!\n\n" . 343 | "🔧 How to Use?\n" . 344 | "1️⃣ Click the buttons below to share a chat or user.\n" . 345 | "2️⃣ Receive the unique ID instantly.\n\n" . 346 | "💎 Features:\n" . 347 | "- Supports users, bots, private/public groups & channels\n" . 348 | "- Fast and reliable\n\n" . 349 | "
🛠 Made with ❤️ By @ItsSmartDev
"; 350 | sendHTMLMessage($BOT_TOKEN, $chat_id, $reply_text, $menu_buttons, true); 351 | logInfo("Sent /start message with keyboard to chat_id: $chat_id"); 352 | } 353 | 354 | if ($text === '/my') { 355 | logInfo("Handling /my command for chat_id: $chat_id"); 356 | $reply_text = "📚 Your Channels and Groups\n\n" . 357 | "🔧 How to Use?\n" . 358 | "1️⃣ Click the buttons below to share your channel or group.\n" . 359 | "2️⃣ Receive the unique ID instantly.\n\n" . 360 | "
🛠 Made with ❤️ By @ItsSmartDev
"; 361 | sendHTMLMessage($BOT_TOKEN, $chat_id, $reply_text, $my_buttons, true); 362 | logInfo("Sent /my message with keyboard to chat_id: $chat_id"); 363 | } 364 | 365 | if ($text === '/admin') { 366 | logInfo("Handling /admin command for chat_id: $chat_id"); 367 | $reply_text = "🛡️ Channels and Groups Where You Are Admin\n\n" . 368 | "🔧 How to Use?\n" . 369 | "1️⃣ Click the buttons below to share a channel or group where you have admin privileges.\n" . 370 | "2️⃣ Receive the unique ID instantly.\n\n" . 371 | "
🛠 Made with ❤️ By @ItsSmartDev
"; 372 | sendHTMLMessage($BOT_TOKEN, $chat_id, $reply_text, $admin_buttons, true); 373 | logInfo("Sent /admin message with keyboard to chat_id: $chat_id"); 374 | } 375 | 376 | if ($text === '👥 Admins Chat') { 377 | logInfo("Admins Chat button clicked for chat_id: $chat_id"); 378 | $reply_text = "🛡️ Channels and Groups Where You Are Admin\n\n" . 379 | "🔧 How to Use?\n" . 380 | "1️⃣ Click the buttons below to share a channel or group where you have admin privileges.\n" . 381 | "2️⃣ Receive the unique ID instantly.\n\n" . 382 | "
🛠 Made with ❤️ By @ItsSmartDev
"; 383 | sendHTMLMessage($BOT_TOKEN, $chat_id, $reply_text, $admin_buttons, true); 384 | logInfo("Sent Admins Chat message with keyboard to chat_id: $chat_id"); 385 | } 386 | 387 | if ($text === '👑 Owner Chat') { 388 | logInfo("Owner Chat button clicked for chat_id: $chat_id"); 389 | $reply_text = "📚 Your Channels and Groups\n\n" . 390 | "🔧 How to Use?\n" . 391 | "1️⃣ Click the buttons below to share your channel or group.\n" . 392 | "2️⃣ Receive the unique ID instantly.\n\n" . 393 | "
🛠 Made with ❤️ By @ItsSmartDev
"; 394 | sendHTMLMessage($BOT_TOKEN, $chat_id, $reply_text, $my_buttons, true); 395 | logInfo("Sent Owner Chat message with keyboard to chat_id: $chat_id"); 396 | } 397 | 398 | if ($text === '🔙 Back') { 399 | logInfo("Back button clicked for chat_id: $chat_id"); 400 | $reply_text = "👋 Welcome to Chat ID Finder Bot! 🆔\n\n" . 401 | "✅ Fetch Any Chat ID Instantly!\n\n" . 402 | "🔧 How to Use?\n" . 403 | "1️⃣ Click the buttons below to share a chat or user.\n" . 404 | "2️⃣ Receive the unique ID instantly.\n\n" . 405 | "💎 Features:\n" . 406 | "- Supports users, bots, private/public groups & channels\n" . 407 | "- Fast and reliable\n\n" . 408 | "
🛠 Made with ❤️ By @ItsSmartDev
"; 409 | sendHTMLMessage($BOT_TOKEN, $chat_id, $reply_text, $menu_buttons, true); 410 | logInfo("Sent Back message with keyboard to chat_id: $chat_id"); 411 | } 412 | 413 | if (isset($message['users_shared'])) { 414 | logInfo("Handling users_shared message"); 415 | 416 | $request_id = $message['users_shared']['request_id'] ?? null; 417 | if (!$request_id || !isset($types[$request_id])) { 418 | logError("Invalid or missing request_id for users_shared"); 419 | $response = "⚠️ Error: Invalid user type shared."; 420 | sendHTMLMessage($BOT_TOKEN, $chat_id, $response); 421 | exit; 422 | } 423 | 424 | $type = $types[$request_id]['name']; 425 | $users = $message['users_shared']['users'] ?? []; 426 | 427 | if (empty($users)) { 428 | logError("No users in users_shared for request_id $request_id"); 429 | $response = "⚠️ Error: Unable to retrieve $type information."; 430 | sendHTMLMessage($BOT_TOKEN, $chat_id, $response); 431 | exit; 432 | } 433 | 434 | foreach ($users as $user) { 435 | $user_id = $user['user_id'] ?? 'Unknown'; 436 | $first_name = $user['first_name'] ?? ''; 437 | $last_name = $user['last_name'] ?? ''; 438 | $username = isset($user['username']) ? "@{$user['username']}" : "No username"; 439 | $full_name = trim("$first_name $last_name"); 440 | 441 | logInfo("Processing shared user: ID=$user_id, Name=$full_name, Username=$username"); 442 | 443 | $text = "Shared $type Info\n"; 444 | $text .= "Type: $type\n"; 445 | $text .= "ID: $user_id\n"; 446 | $text .= "Name: $full_name\n"; 447 | $text .= "Username: $username"; 448 | 449 | $keyboard = [ 450 | 'inline_keyboard' => [ 451 | [ 452 | [ 453 | 'text' => $full_name, 454 | 'copy_text' => [ 455 | 'text' => (string)$user_id 456 | ] 457 | ] 458 | ] 459 | ] 460 | ]; 461 | 462 | if (isset($user['photo']) && is_array($user['photo']) && !empty($user['photo'])) { 463 | $photos = $user['photo']; 464 | $photo_file_id = null; 465 | 466 | if (isset($photos[0]['file_id'])) { 467 | $photo_file_id = $photos[0]['file_id']; 468 | } elseif (isset($photos['small_file_id'])) { 469 | $photo_file_id = $photos['small_file_id']; 470 | } 471 | 472 | if ($photo_file_id) { 473 | logInfo("Sending user info with photo for user_id: $user_id"); 474 | sendPhoto($BOT_TOKEN, $chat_id, $photo_file_id, $text, $keyboard); 475 | } else { 476 | logInfo("Sending user info without photo for user_id: $user_id"); 477 | sendHTMLMessage($BOT_TOKEN, $chat_id, $text, $keyboard); 478 | } 479 | } else { 480 | logInfo("Sending user info without photo for user_id: $user_id"); 481 | sendHTMLMessage($BOT_TOKEN, $chat_id, $text, $keyboard); 482 | } 483 | } 484 | } 485 | 486 | if (isset($message['chat_shared'])) { 487 | logInfo("Handling chat_shared message"); 488 | 489 | $request_id = $message['chat_shared']['request_id'] ?? null; 490 | if (!$request_id || !isset($types[$request_id])) { 491 | logError("Invalid or missing request_id for chat_shared"); 492 | $response = "⚠️ Error: Invalid chat type shared."; 493 | sendHTMLMessage($BOT_TOKEN, $chat_id, $response); 494 | exit; 495 | } 496 | 497 | $type = $types[$request_id]['name']; 498 | $shared_id = $message['chat_shared']['chat_id'] ?? 'Unknown'; 499 | $title = $message['chat_shared']['title'] ?? 'Unnamed Chat'; 500 | $username = isset($message['chat_shared']['username']) ? "@{$message['chat_shared']['username']}" : "No username"; 501 | 502 | if ($shared_id === 'Unknown') { 503 | logError("Missing chat_id in chat_shared for request_id $request_id"); 504 | $response = "⚠️ Error: Unable to retrieve $type ID."; 505 | sendHTMLMessage($BOT_TOKEN, $chat_id, $response); 506 | exit; 507 | } 508 | 509 | logInfo("Processing shared chat: ID=$shared_id, Title=$title, Username=$username"); 510 | 511 | $text = "Shared $type Info\n"; 512 | $text .= "Type: $type\n"; 513 | $text .= "ID: $shared_id\n"; 514 | $text .= "Name: $title\n"; 515 | $text .= "Username: $username"; 516 | 517 | $keyboard = [ 518 | 'inline_keyboard' => [ 519 | [ 520 | [ 521 | 'text' => $title, 522 | 'copy_text' => [ 523 | 'text' => (string)$shared_id 524 | ] 525 | ] 526 | ] 527 | ] 528 | ]; 529 | 530 | if (isset($message['chat_shared']['photo']) && is_array($message['chat_shared']['photo']) && !empty($message['chat_shared']['photo'])) { 531 | $photos = $message['chat_shared']['photo']; 532 | $photo_file_id = null; 533 | 534 | if (isset($photos[0]['file_id'])) { 535 | $photo_file_id = $photos[0]['file_id']; 536 | } elseif (isset($photos['small_file_id'])) { 537 | $photo_file_id = $photos['small_file_id']; 538 | } 539 | 540 | if ($photo_file_id) { 541 | logInfo("Sending chat info with photo for chat_id: $shared_id"); 542 | sendPhoto($BOT_TOKEN, $chat_id, $photo_file_id, $text, $keyboard); 543 | } else { 544 | logInfo("Sending chat info without photo for chat_id: $shared_id"); 545 | sendHTMLMessage($BOT_TOKEN, $chat_id, $text, $keyboard); 546 | } 547 | } else { 548 | logInfo("Sending chat info without photo for chat_id: $shared_id"); 549 | sendHTMLMessage($BOT_TOKEN, $chat_id, $text, $keyboard); 550 | } 551 | } 552 | 553 | ?> 554 | --------------------------------------------------------------------------------