mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 11:10:18 +03:00
Use get_message_id instead
This commit is contained in:
parent
1c7947c03a
commit
75142e2fdc
|
@ -1210,13 +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
|
||||
elif hasattr(message, 'id'):
|
||||
message = message.id
|
||||
elif not isinstance(message, int):
|
||||
raise ValueError('Incorrect message argument')
|
||||
|
||||
message = utils.get_message_id(message) or 0
|
||||
entity = await self.get_input_entity(entity)
|
||||
await self(functions.messages.UpdatePinnedMessageRequest(
|
||||
peer=entity,
|
||||
|
|
Loading…
Reference in New Issue
Block a user