Skip to content

sendPhoto

Sahri Riza Umami edited this page Mar 13, 2017 · 4 revisions

Send a photo message.

sendPhoto(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, photo, caption)  
Option Description
chat_id Chat to send message.
reply_to_message_id Identifier of a message to reply to or 0.
disable_notification Pass true, to disable notification about the message.
from_background Pass true, if the message is sent from background.
reply_markup Bots only. Markup for replying to message.
photo Photo to send
caption Photo caption, 0-200 characters

Example

  • Send a photo message from a sent message using its file (photo) id 212 to group 1234567890.

    sendPhoto(1234567890, 0, 0, 1, nil, 212, 'This is a photo.')
  • Send a photo message from a sent message by its persistent_id.

    sendPhoto(1234567890, 0, 0, 1, nil, 'AgADBQADWagxG2dukwvtaMb44zOBXrYfyjIABHH4Zoiei4pn0RgBAAEC')  
  • Send a photo message from local storage.

    sendPhoto(1234567890, 0, 0, 1, nil, '/tmp/photo.jpg', 'Uploaded from /tmp')

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally