From b826d0d4dd24151d2134043969a3e6c9bb782272 Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 5 Nov 2024 13:07:25 -0500 Subject: [PATCH] Add includeCommand parameter to getAnyText method --- src/TgBotLib/Objects/Message.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TgBotLib/Objects/Message.php b/src/TgBotLib/Objects/Message.php index 82148ea..4a63a34 100644 --- a/src/TgBotLib/Objects/Message.php +++ b/src/TgBotLib/Objects/Message.php @@ -1026,11 +1026,12 @@ /** * Retrieves any available text, prioritizing 'text' over 'caption'. * + * @param bool $includeCommand * @return string|null */ - public function getAnyText(): ?string + public function getAnyText(bool $includeCommand=false): ?string { - return $this->text ?? $this->caption; + return $this->getText($includeCommand) ?? $this->getCaption($includeCommand); } /**