Search code examples
pythontelegramtelethon

How can I send an image with a caption using Telethon in python?


I'm aware I can use this

client.send_file(receiver, '/path/to/photo.jpg')

to send an image, but how can I attach a caption to the image?


Solution

  • According to the documentation just pass the value of the caption with a keyword argument like so client.send_file(chat, '/my/photos/me.jpg', caption="It's me!"). You can read the documentation here