From 16595123c5991d53cbd419f7973510f4ee9e4801 Mon Sep 17 00:00:00 2001 From: Anatras02 <39670708+Anatras02@users.noreply.github.com> Date: Thu, 24 Dec 2020 15:42:11 +0100 Subject: [PATCH] Update inline_keyboard.py --- pykeyboard/inline_keyboard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pykeyboard/inline_keyboard.py b/pykeyboard/inline_keyboard.py index d818884..cfcf5dd 100644 --- a/pykeyboard/inline_keyboard.py +++ b/pykeyboard/inline_keyboard.py @@ -8,8 +8,9 @@ class InlineKeyboard(InlineKeyboardMarkup): self.row_width = row_width def add(self, *args): + checkType = lambda element : True if type(element).__name__ == "InlineKeyboardButton" else False self.inline_keyboard = [ - args[i:i + self.row_width] + list(filter(checkType,list(args[i:i + self.row_width]))) for i in range(0, len(args), self.row_width) ]