From 4839d8bf59f9d69ddc8bb29dbefd8631a5cb0624 Mon Sep 17 00:00:00 2001 From: painor Date: Mon, 4 Nov 2019 09:46:17 +0100 Subject: [PATCH] Fix pin_message not accepting Message objects (#1322) --- telethon/client/messages.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/telethon/client/messages.py b/telethon/client/messages.py index de9e7b75..4dc72bd7 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -1210,9 +1210,7 @@ class MessageMethods: message = await client.send_message(chat, 'Pinotifying is fun!') await client.pin_message(chat, message, notify=True) """ - if not message: - message = 0 - + message = utils.get_message_id(message) or 0 entity = await self.get_input_entity(entity) await self(functions.messages.UpdatePinnedMessageRequest( peer=entity,