-
Notifications
You must be signed in to change notification settings - Fork 175
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
BUTTON_TYPE_INVALID when inline keyboard is used as reply_markup in InlineQueryResults #110
Comments
Oh, that should not happen. Any empty set of properties should not be populated, even if it is a subobject. I'll have a look at it and come back to you about it! |
The problem lies in the fact that the reply_markup button does not get cleaned in
Since the Button is actually a Type and not a Method, I'll have to come up with some way of cleaning it. Creating a new object isn't the way to do this, maybe a recursive call to each sub-element is the solution, but I'm not really a fan of this either. I'll play around with some ideas. |
can this do the trick? https://www.php.net/manual/en/function.array-filter.php |
guys, do you know Telegram is going to add this opportunity? I mean setting pyment button to inline keyboard? Thanks |
You can do that already. Quoting Telegram docs: “This type of button (pay button) must always be the first button in the first row” |
@MrDarkest i tried it, i set only one pay button, got after that BUTTON_TYPE_INVALID. Maybe you know how to get it through? |
This error is coming when sending a webApp button as reply markup of inline query result. This button is only button in markup |
Found this lines in the docs. Web app button is only available in private chats |
Well, the exact same issue i encounter in python aiogram library! Exactly as here. I don't know php, but if the issue is same for another library than it's telegram's fault. |
Which version are you using?
3.5.0
Output:
Description of problem
When I set up a Markup object to use it in reply_markup property of Article class I get an error from Telegram:
Digging in the code I've find out that the problem is the button in the Markup.
I've set the Button like this:
and passed it to reply_markup property:
But apparently Telegram dislike the "pay" and the "callback_game" properties of the Button in the json body if the button is used in AnswerInlineQuery even if they are null (in "callback_game" case) or false (in "pay" case).
I fixed temporary the problem by creating a new class (I called it "ButtonInlineAnswer") coping Button class, removing "pay" and "callback_game" properties and use this class instead of Button in the code before:
If this can be accepted as solution I can open a pull request with this new class but if a better one can be found I'm glad to wait the official fix using mine meanwhile.
The text was updated successfully, but these errors were encountered: