Skip to content

Conversation

@arassypnov
Copy link
Contributor

No description provided.

@noplanman noplanman merged commit 20cc1b9 into php-telegram-bot:master Dec 18, 2016
@noplanman
Copy link
Member

@jacklul Regarding your keyboard issue (#349), try this fix.

@jacklul
Copy link
Collaborator

jacklul commented Dec 18, 2016

Now the reply_markup returns completely empty.

Array
(
    [chat_id] => 12345
    [text] => Test
    [parse_mode] => HTML
    [disable_web_page_preview] => 1
    [disable_notification] => 1
    [reply_markup] => Longman\TelegramBot\Entities\InlineKeyboard Object
        (
            [inline_keyboard] => Array
                (
                )

            [raw_data] => Array
                (
                    [inline_keyboard] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

            [bot_name] => 
        )

)

@noplanman
Copy link
Member

Using the standard array way of creating the keyboard, the Keyboard object doesn't work, yet.
So if you set up the keyboard in simple array fashion, as the default Telegram style, it works.

Your example from the issue #349 would work like this:

$inline_keyboard = [
	[
		[
			'text' => $text['button_text'],
			'url' => $text['button_url']
		]
	],
	[
		[
			'text' => 'Clear',
			'callback_data' => 'clear'
		]
	]
];

$data['reply_markup'] = ['inline_keyboard' => $inline_keyboard];

Basically, just without using the InlineKeyboard object.

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