How can I send photo to telegram user with telethon

Viewed 5427

Currently I'm using this method that sends text to user but how can I send photo to user with module Telethon

client.send_message(receiver, message.format(user['name'])
1 Answers

As @vlz said in the comment, client.send_file listed in the documentation is the right method to use:

# note: local paths work just as well
# note: await is needed if used inside async def
await client.send_file(receiver, '/path/to/photo.jpg')
Related