From 7996b20889bc66dc4f701e377c5725ca0bee0167 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Fri, 15 Nov 2024 18:34:25 +0330 Subject: [PATCH 1/2] Update CallbackQuery.php - as we can provide url with empty message so $message parameter can be nullable here and can accept null too! --- src/EventHandler/CallbackQuery.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EventHandler/CallbackQuery.php b/src/EventHandler/CallbackQuery.php index 392e7ad67..38b79c5c3 100644 --- a/src/EventHandler/CallbackQuery.php +++ b/src/EventHandler/CallbackQuery.php @@ -40,13 +40,13 @@ abstract class CallbackQuery extends Update } /** - * @param string $message Popup to show + * @param ?string $message Popup to show * @param bool $alert Whether to show the message as a popup instead of a toast notification * @param string|null $url URL to open * @param int $cacheTime Cache validity (default set to 5 min based on telegram official docs ...) */ public function answer( - string $message, + ?string $message = null, bool $alert = false, ?string $url = null, int $cacheTime = 5 * 60 From 5dc97c91cdbfae2fffff6cb0b98da3d685fb5e07 Mon Sep 17 00:00:00 2001 From: Mahdi Date: Fri, 15 Nov 2024 18:39:13 +0330 Subject: [PATCH 2/2] Small refactor --- src/EventHandler/CallbackQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EventHandler/CallbackQuery.php b/src/EventHandler/CallbackQuery.php index 38b79c5c3..852513813 100644 --- a/src/EventHandler/CallbackQuery.php +++ b/src/EventHandler/CallbackQuery.php @@ -40,7 +40,7 @@ abstract class CallbackQuery extends Update } /** - * @param ?string $message Popup to show + * @param ?string $message Popup to show * @param bool $alert Whether to show the message as a popup instead of a toast notification * @param string|null $url URL to open * @param int $cacheTime Cache validity (default set to 5 min based on telegram official docs ...)