Skip to content

Keyboard issue in 0.37 #349

@jacklul

Description

@jacklul

So I migrated my bot to 0.37 from 0.35 following all changes and it seems like something is wrong with Keyboard/InlineKeyboard entity.

Assuming we have buttons array like this (shows buttons under each other):

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

$data['reply_markup'] = new InlineKeyboardMarkup(['inline_keyboard' => $inline_keyboard]);

in 0.35 worked fine, migrating to 0.37 with following change doesn't work:

$data['reply_markup'] = new InlineKeyboard($inline_keyboard);

Telegram API replies Bad Request: REPLY_MARKUP_INVALID

Changing code to:

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

Works, but will make the buttons show up next to each other, not under each other!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions