mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-03 03:30:09 +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!')
|
message = await client.send_message(chat, 'Pinotifying is fun!')
|
||||||
await client.pin_message(chat, message, notify=True)
|
await client.pin_message(chat, message, notify=True)
|
||||||
"""
|
"""
|
||||||
if not message:
|
message = utils.get_message_id(message) or 0
|
||||||
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)
|
entity = await self.get_input_entity(entity)
|
||||||
await self(functions.messages.UpdatePinnedMessageRequest(
|
await self(functions.messages.UpdatePinnedMessageRequest(
|
||||||
peer=entity,
|
peer=entity,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user