Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getReplyMarkup() doesn't return actual reply markup #323

Open
artemijdeleto opened this issue Mar 15, 2021 · 3 comments
Open

getReplyMarkup() doesn't return actual reply markup #323

artemijdeleto opened this issue Mar 15, 2021 · 3 comments

Comments

@artemijdeleto
Copy link

artemijdeleto commented Mar 15, 2021

Problem

Getting null when trying to get reply markup of the message using getReplyMarkup

Expected result

Getting instance of InlineKeyboardMarkup, as documented in the source code

Steps to reproduce

  1. Send message with InlineKeyboardMarkup passed to replyMarkup parameter, providing text and callback_data
  2. Open any Telegram client application and click on created button
  3. Capture callback event using $client->callbackQuery()
  4. Try to get reply markup of the message using $query->getMessage()->getReplyMarkup()

The result of the following steps will be null.
I printed out the raw body and definitely sure that JSON that sent back to the server contains reply_markup field

@dazeron
Copy link

dazeron commented Sep 3, 2021

I have the same problem. But I use
$messageData = $bot->sendMessage(..., $inline_keyboard); $messageData->getReplyMarkup(); // returns NULL
I don't know, what to do...

@dazeron
Copy link

dazeron commented Sep 3, 2021

I've tried to check Types/Message.php and I added to static protected $map = [] new element 'reply_markup' => InlineKeyboardMarkup::class (I saw, that there are all the key=>value pairs from telegram api docs, but 'reply_markup' are not), but this just broke the bot :( I'm sure some developers stuck this problem too.

@bernard-ng
Copy link
Contributor

#385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants