From 46e19c395cd7f7136d0d386857b5535a3f9d2f5d Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 4 Nov 2018 11:36:10 +0100 Subject: [PATCH] Don't encode callback data when sending inline buttons --- pyrogram/client/types/bots/inline_keyboard_button.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/types/bots/inline_keyboard_button.py b/pyrogram/client/types/bots/inline_keyboard_button.py index ce93d96b..3d6c7b6b 100644 --- a/pyrogram/client/types/bots/inline_keyboard_button.py +++ b/pyrogram/client/types/bots/inline_keyboard_button.py @@ -59,7 +59,7 @@ class InlineKeyboardButton(Object): def __init__( self, text: str, - callback_data: str = None, + callback_data: bytes = None, url: str = None, switch_inline_query: str = None, switch_inline_query_current_chat: str = None, @@ -102,7 +102,7 @@ class InlineKeyboardButton(Object): def write(self): if self.callback_data: - return KeyboardButtonCallback(self.text, self.callback_data.encode()) + return KeyboardButtonCallback(self.text, self.callback_data) if self.url: return KeyboardButtonUrl(self.text, self.url)