@ -1,6 +1,14 @@
PostToTelegram:
PostToTelegram:
;------------------------------------------------
;------------------------------------------------
CurrentSocialMediaPosting := "Telegram"
CurrentSite := "Telegram"
if(!FileExist(VideoThumbFilepath)){
Message = Post Aborted.`nVideo Thumbnail not found at:`n%VideoThumbFilepath%
SaveOrPostProgress(Message,PostType:="ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
MsgBox 0x10,, %Message%
Return
}
Message = Posting Video Links to Telegram
Message = Posting Video Links to Telegram
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging")
@ -90,11 +98,10 @@ if(StrLenOfMessageAndVideoLinks < 1024) {
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
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. Please See Errorlog For More Info .
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
; SaveOrPostProgress(Message:=Status,PostType:=",ErrorLoggingTextFile")
Message = Telegram API Error:`n %Status%
Message = Telegram Error: %Status%
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging")
ToolTip
ToolTip
@ -129,8 +136,9 @@ else, {
; ------------------------------------------------
; ------------------------------------------------
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
Message = API Response:`n%Status% ; Output returned data to ErrorLog File
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
; 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)
@ -149,7 +157,6 @@ else, {
}
}
}
}
; 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