A wrapper for the Telegram sendMessage function to send a screenshot of all displays (non-blocking execution).
This function invokes an asynchronous request to the Telegram API. To avoid any blocking of the calling function the execution immediatly returns after the request was executed. It won't wait for the callback. This means you can not ensure that the message was successfully sent. If you need to ensure message delivery, use TelegramSendScreen instead.
The Telegram bot API key
The Telegram chat ID that will receive the message
The caption for the screenshot
A string indicating if the request was successfully executed. 0 means there was no failure.
Print(TelegramSendScreenAsync(apikey, chatid, "test photo")); // Will print "0" on success
- This function is especially useful if you have a single screen with Metatrader as active window. Use TelegramSendPhoto[Async] or TelegramSendDocument[Async] in conjunction with MQL native functions like chartscreenshot instead if you need to send file based pictures or chart screenshots.
- The same is valid if your pictures exceed a maximum resolution/size. Telegram will then shrink the size of your screenshots.