Skip to content

Commit c56eaea

Browse files
authored
converted if's to elseif's to make it be quicker
1 parent a99576f commit c56eaea

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bot examples/webhook/update.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@
6363
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => $reply);
6464
$telegram->sendMessage($content);
6565
}
66-
if ($text == "/git") {
66+
67+
elseif ($text == "/git") {
6768
$reply = "Check me on GitHub: https://github.com/Eleirbag89/TelegramBotPHP";
6869
// Build the reply array
6970
$content = array('chat_id' => $chat_id, 'text' => $reply);
7071
$telegram->sendMessage($content);
7172
}
7273

73-
if ($text == "/img") {
74+
elseif ($text == "/img") {
7475
// Load a local file to upload. If is already on Telegram's Servers just pass the resource id
7576
$img = curl_file_create('test.png','image/png');
7677
$content = array('chat_id' => $chat_id, 'photo' => $img );
@@ -81,7 +82,7 @@
8182
$telegram->downloadFile($file["result"]["file_path"], "./test_download.png");
8283
}
8384

84-
if ($text == "/where") {
85+
elseif ($text == "/where") {
8586
// Send the Catania's coordinate
8687
$content = array('chat_id' => $chat_id, 'latitude' => "37.5", 'longitude' => "15.1" );
8788
$telegram->sendLocation($content);

0 commit comments

Comments
 (0)