Skip to content

Conversation

@noplanman
Copy link
Member

Prevent an error exception when an empty inline query is being handled.

@noplanman noplanman force-pushed the no_empty_inline_query branch from 5c12a69 to 4cd67ce Compare July 3, 2016 22:28
@jacklul
Copy link
Collaborator

jacklul commented Jul 4, 2016

Wait, I think Telegram expects answerInlineQuery even to empty queries, I think with your solution user will see infinity loading icon with empty query!

@noplanman
Copy link
Member Author

Aaah yes, you're right!
So we'll need to find a different solution. The problem is, that if the inline query is empty, I get the following error:
{"ok":false,"error_code":400,"description":"Bad Request: Message must be non-empty"}

@jacklul
Copy link
Collaborator

jacklul commented Jul 5, 2016

Maybe just
'input_message_content' => new InputTextMessageContent([ 'message_text' => 'you enter: ' . $query
or when query is empty don't show any results (results array should be empty)

@noplanman
Copy link
Member Author

@jacklul Have modified it to return an empty result, much better, thanks!

@MBoretto MBoretto merged commit dd0b61f into php-telegram-bot:develop Jul 25, 2016
@noplanman noplanman deleted the no_empty_inline_query branch July 25, 2016 07:25
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

Successfully merging this pull request may close these issues.

3 participants