if(ImageAttachmentFilepath != "" AND StrLen(Message) > 1020){ ; utilize function that converts image to MIME/multi form
; Telegram API character limit of 4096 for a basic message.
; @todo: add functionality to split messages longer than 4096 characters
; msgbox, 2
if(BoldTitleWAPI)
TelegramTitle := "*" . TelegramTitle . "*"
else,
TelegramTitle := TelegramTitle
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, ImageAttachmentFilepath, caption := TelegramTitle ) ; you could add more options; compare the Telegram API docs
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBody )
}
else if(ImageAttachmentFilepath != "" AND StrLen(Message) <= 1020){
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, ImageAttachmentFilepath, caption := Message ) ; you could add more options; compare the Telegram API docs
}
else,
{ ; send just the text
; Msgbox % "Message: " Message
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Message )