4

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'])
Shiv Singh
  • 41
  • 1
  • 2
  • 1
    Did you look at Telethons [Documentaton for the Client](https://docs.telethon.dev/en/latest/quick-references/client-reference.html#client-ref)? It has methods named "send_file" and "upload_file" which might help you. – vlz Sep 17 '20 at 09:39

1 Answers1

3

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')
Lonami
  • 5,945
  • 2
  • 20
  • 38