A wrapper for the Telegram sendMessage function to send a photo (blocking execution).
This function invokes an asynchronous request to the Telegram API. To ensure successful sending of the message this function waits for the callback. If you need to return back to the caller function quickly use TelegramSendPhotoAsync instead.
The Telegram bot API key
The Telegram chat ID that will receive the message
The path to the file that shall be sent
The caption for the photo
A string indicating if the request was successfully invoked. 0 means there was no failure.
Print(TelegramSendPhoto(apikey, chatid, "F:\\testpic.jpg", "test photo")); // Will print "0" on success
- Use this function in conjunction with MQL native functions like chartscreenshot.
- If your pictures exceed a maximum resolution/size Telegram will shrink the size of your pictures. Use TelegramSendDocument[Async] instead to send full sized images.