Skip to content

Commit dd3cfba

Browse files
committed
added an additional type check
1 parent 7913106 commit dd3cfba

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/BotApi.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function sendMessage($chatId, $text, $disablePreviw = false, $replyToMess
121121
'text' => $text,
122122
'disable_web_page_preview' => $disablePreviw,
123123
'reply_to_message_id' => (int) $replyToMessageId,
124-
'reply_markup' => $replyMarkup->toJson()
124+
'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson()
125125
)));
126126
}
127127

@@ -249,7 +249,7 @@ public function sendLocation($chatId, $latitude, $longitude, $replyToMessageId =
249249
'latitude' => $latitude,
250250
'longitude' => $longitude,
251251
'reply_to_message_id' => $replyToMessageId,
252-
'reply_markup' => $replyMarkup->toJson()
252+
'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson()
253253
)));
254254
}
255255

@@ -271,7 +271,7 @@ public function sendSticker($chatId, $sticker, $replyToMessageId = null, $replyM
271271
'chat_id' => (int) $chatId,
272272
'sticker' => $sticker,
273273
'reply_to_message_id' => $replyToMessageId,
274-
'reply_markup' => $replyMarkup->toJson()
274+
'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson()
275275
)));
276276
}
277277

@@ -295,7 +295,7 @@ public function sendVideo($chatId, $video, $replyToMessageId = null, $replyMarku
295295
'chat_id' => (int) $chatId,
296296
'video' => $video,
297297
'reply_to_message_id' => $replyToMessageId,
298-
'reply_markup' => $replyMarkup->toJson()
298+
'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson()
299299
)));
300300
}
301301

@@ -341,7 +341,7 @@ public function sendAudio($chatId, $audio, $replyToMessageId = null, $replyMarku
341341
'chat_id' => (int) $chatId,
342342
'audio' => $audio,
343343
'reply_to_message_id' => $replyToMessageId,
344-
'reply_markup' => $replyMarkup->toJson()
344+
'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson()
345345
)));
346346
}
347347

@@ -365,7 +365,7 @@ public function sendPhoto($chatId, $photo, $caption = null, $replyToMessageId =
365365
'photo' => $photo,
366366
'caption' => $caption,
367367
'reply_to_message_id' => $replyToMessageId,
368-
'reply_markup' => $replyMarkup->toJson()
368+
'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson()
369369
)));
370370
}
371371

@@ -388,7 +388,7 @@ public function sendDocument($chatId, $document, $replyToMessageId = null, $repl
388388
'chat_id' => (int) $chatId,
389389
'document' => $document,
390390
'reply_to_message_id' => $replyToMessageId,
391-
'reply_markup' => $replyMarkup->toJson()
391+
'reply_markup' => is_null($replyMarkup) ? $replyMarkup : $replyMarkup->toJson()
392392
)));
393393
}
394394

0 commit comments

Comments
 (0)