Skip to content

Don't allow more than 2 dimensional input for Inline/ReplyKeyboardMarkup #3511

@harshil21

Description

@harshil21

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

When a user passes their list to Inline/ReplyKeyboardMarkup, we currently check if their input is valid (exactly 2 dimensional input is valid), i.e.

  • the input is a sequence, not just a single button
  • it's not just a simple sequence (sequence of buttons)

However it doesn't check if it's more than 2D, i.e. [[[KeyboardButton(...)], [...], ]] is invalid.

Describe the solution you'd like

Modify tg._utils.markup.check_keyboard_type to return False if we find another sequence.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions