Skip to content

Commit cccd3ad

Browse files
committed
Fix issue 86 switch_inline_query and switch_inline_query_current_chat can be empty in InlineButton
1 parent 2af1366 commit cccd3ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Telegram.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ public function buildInlineKeyBoard(array $options)
15921592
* \param $pay Boolean Optional. Specify True, to send a <a href="https://core.telegram.org/bots/api#payments">Pay button</a>.
15931593
* \return the requested button as Array
15941594
*/
1595-
public function buildInlineKeyboardButton($text, $url = "", $callback_data = "", $switch_inline_query = "", $switch_inline_query_current_chat = "", $callback_game = "", $pay = "")
1595+
public function buildInlineKeyboardButton($text, $url = "", $callback_data = "", $switch_inline_query = null, $switch_inline_query_current_chat = null, $callback_game = "", $pay = "")
15961596
{
15971597
$replyMarkup = array(
15981598
'text' => $text
@@ -1601,9 +1601,9 @@ public function buildInlineKeyboardButton($text, $url = "", $callback_data = "",
16011601
$replyMarkup['url'] = $url;
16021602
} else if ($callback_data != "") {
16031603
$replyMarkup['callback_data'] = $callback_data;
1604-
} else if ($switch_inline_query != "") {
1604+
} else if (!is_null($switch_inline_query)) {
16051605
$replyMarkup['switch_inline_query'] = $switch_inline_query;
1606-
} else if ($switch_inline_query_current_chat != "") {
1606+
} else if (!is_null($switch_inline_query_current_chat)) {
16071607
$replyMarkup['switch_inline_query_current_chat'] = $switch_inline_query_current_chat;
16081608
} else if ($callback_game != "") {
16091609
$replyMarkup['callback_game'] = $callback_game;

0 commit comments

Comments
 (0)