From d14bd9a36ba6ae34db25e684698b5c8f221a4a21 Mon Sep 17 00:00:00 2001 From: Yolley Date: Tue, 6 Dec 2016 17:12:28 +0300 Subject: [PATCH] Add isinstance for bytes to function 'add' in ReplyKeyboardMarkup All explanation is here https://github.com/eternnoir/pyTelegramBotAPI/issues/265 --- telebot/types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telebot/types.py b/telebot/types.py index 7ee76a7..2ae5d2a 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -619,6 +619,8 @@ class ReplyKeyboardMarkup(JsonSerializable): for button in args: if util.is_string(button): row.append({'text': button}) + elif isinstance(button, bytes): + row.append({'text': button.decode('utf-8')}) else: row.append(button.to_dic()) if i % self.row_width == 0: