|
|
|
@@ -83,6 +83,11 @@ StrLenOfMessageAndVideoLinks := StrLen(TelegramVideoTitle) + StrLen(TelegramBody
|
|
|
|
; ------------------------------------------------
|
|
|
|
; ------------------------------------------------
|
|
|
|
if(StrLenOfMessageAndVideoLinks < 1024) {
|
|
|
|
if(StrLenOfMessageAndVideoLinks < 1024) {
|
|
|
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramMessage ) ; you could add more options; compare the Telegram API docs
|
|
|
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramMessage ) ; you could add more options; compare the Telegram API docs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Output returned data to ErrorLog File
|
|
|
|
|
|
|
|
Message = API Response:`n%Status%
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
|
|
if(InStr(Status, "error_code")){
|
|
|
|
if(InStr(Status, "error_code")){
|
|
|
|
Message = Telegram Post Failed due to an API Issue. Error was saved to ErrorLogging file. Please send it to Yuriy.
|
|
|
|
Message = Telegram Post Failed due to an API Issue. Error was saved to ErrorLogging file. Please send it to Yuriy.
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
|
|
|
|
@@ -104,48 +109,59 @@ if(StrLenOfMessageAndVideoLinks < 4096){
|
|
|
|
; Photo and Video Title go into SendPhoto
|
|
|
|
; Photo and Video Title go into SendPhoto
|
|
|
|
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
|
|
|
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
|
|
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
|
|
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
|
|
|
|
|
|
|
; Output returned data to ErrorLog File
|
|
|
|
|
|
|
|
Message = API Response:`n%Status%
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
|
|
; Video Description goes into TelegramMessage
|
|
|
|
; Video Description goes into TelegramMessage
|
|
|
|
Status2 := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
|
|
|
|
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := TelegramBodymessage)
|
|
|
|
|
|
|
|
; Output returned data to ErrorLog File
|
|
|
|
|
|
|
|
Message = API Response:`n%Status%
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else, {
|
|
|
|
} else, {
|
|
|
|
; If Title, links and message are longer than 4096 chars, we need to split them into multiple messages
|
|
|
|
; If Title, links and message are longer than 4096 chars, we need to split them into multiple messages
|
|
|
|
; ------------------------------------------------
|
|
|
|
; ------------------------------------------------
|
|
|
|
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
|
|
|
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
|
|
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
|
|
|
Status := SendTelegramPhoto(TelegramBotToken, TelegramBotChatID, VideoThumbFilepath, caption := TelegramVideoTitle ) ; you could add more options; compare the Telegram API docs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; Split the Description into 4096 character chunks while preserving sentences
|
|
|
|
; Split the Description into 4096 character chunks while preserving sentences
|
|
|
|
; Used 4095 because a ". " has to be put in at the end of the chunk.
|
|
|
|
; Used 4095 because a ". " has to be put in at the end of the chunk.
|
|
|
|
VideoDescriptionChunks := SplitStringWithSentences(TelegramBodymessage, 4094)
|
|
|
|
VideoDescriptionChunks := SplitStringWithSentences(TelegramBodymessage, 4094)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; go through array and post each chunk as new message
|
|
|
|
; go through array and post each chunk as new message
|
|
|
|
Loop % VideoDescriptionChunks.Length(){
|
|
|
|
Loop % VideoDescriptionChunks.Length(){
|
|
|
|
; ArrayItem := ARRAY[A_Index]
|
|
|
|
; ArrayItem := ARRAY[A_Index]
|
|
|
|
Description := VideoDescriptionChunks[A_Index]
|
|
|
|
Description := VideoDescriptionChunks[A_Index]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
|
|
|
|
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
|
|
|
|
; Clipboard := Description
|
|
|
|
; Output returned data to ErrorLog File
|
|
|
|
; msgbox % Description
|
|
|
|
Message = API Response:`n%Status%
|
|
|
|
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
; Clipboard := Description
|
|
|
|
|
|
|
|
; msgbox % Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
; SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
Message = Video Links Posted to Telegram Successfully
|
|
|
|
Message = Video Links Posted to Telegram Successfully
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")
|
|
|
|
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
|
|
|
|
GuiControl,, PostToTelegramButton, Telegram - Posted Successfully
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; sleep, 2000
|
|
|
|
; sleep, 2000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ToolTip
|
|
|
|
ToolTip
|
|
|
|
CurrentSite :=
|
|
|
|
CurrentSite :=
|
|
|
|
Return
|
|
|
|
Return
|
|
|
|
; -------------------------------/Telegram-------------------------------
|
|
|
|
; -------------------------------/Telegram-------------------------------
|
|
|
|
|