Fix pin message not accepting Message objects

This commit is contained in:
painor 2019-11-03 20:50:42 +01:00 committed by GitHub
parent 3d1ce845be
commit 1c7947c03a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1212,6 +1212,10 @@ class MessageMethods:
"""
if not message:
message = 0
elif hasattr(message, 'id'):
message = message.id
elif not isinstance(message, int):
raise ValueError('Incorrect message argument')
entity = await self.get_input_entity(entity)
await self(functions.messages.UpdatePinnedMessageRequest(