From 0f5f6cc050dce1ee306b5f78c66ad3a8ac22819f Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 28 Jun 2018 15:50:26 +0200 Subject: [PATCH] Fix opposite condition --- telethon/tl/custom/message.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py index 25f2fba8..01397bc1 100644 --- a/telethon/tl/custom/message.py +++ b/telethon/tl/custom/message.py @@ -410,7 +410,10 @@ class Message: """ Returns the total button count. """ - if self._buttons_count is not None and isinstance( + if not isinstance(self.original_message, types.Message): + return 0 + + if self._buttons_count is None and isinstance( self.original_message.reply_markup, ( types.ReplyInlineMarkup, types.ReplyKeyboardMarkup )):