mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Add send_photo method
This commit is contained in:
parent
8570d8a322
commit
a5d1b7f480
@ -542,3 +542,24 @@ class Client:
|
|||||||
)
|
)
|
||||||
finally:
|
finally:
|
||||||
session.stop()
|
session.stop()
|
||||||
|
|
||||||
|
def send_photo(self,
|
||||||
|
chat_id: int or str,
|
||||||
|
photo: str,
|
||||||
|
caption: str = "",
|
||||||
|
ttl_seconds: int = None,
|
||||||
|
disable_notification: bool = None,
|
||||||
|
reply_to_message_id: int = None):
|
||||||
|
return self.send(
|
||||||
|
functions.messages.SendMedia(
|
||||||
|
peer=self.resolve_peer(chat_id),
|
||||||
|
media=types.InputMediaUploadedPhoto(
|
||||||
|
file=self.save_file(photo),
|
||||||
|
caption=caption,
|
||||||
|
ttl_seconds=ttl_seconds
|
||||||
|
),
|
||||||
|
silent=disable_notification or None,
|
||||||
|
reply_to_msg_id=reply_to_message_id,
|
||||||
|
random_id=self.rnd_id()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user