Added API Responses to ErrorLog.txt files
This commit is contained in:
@@ -55,8 +55,9 @@ if(PodcastNumber != "")
|
||||
Message .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
|
||||
|
||||
|
||||
UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
|
||||
|
||||
Status := UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
|
||||
Message = API Response:`n%Status%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
|
||||
|
||||
|
||||
SaveOrPostProgress(Message:="Video Links posted to #Videos Successfully.",PostType:="Tooltip,ErrorLoggingTextFile")
|
||||
|
||||
@@ -83,6 +83,11 @@ StrLenOfMessageAndVideoLinks := StrLen(TelegramVideoTitle) + StrLen(TelegramBody
|
||||
; ------------------------------------------------
|
||||
if(StrLenOfMessageAndVideoLinks < 1024) {
|
||||
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")){
|
||||
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")
|
||||
@@ -104,9 +109,16 @@ if(StrLenOfMessageAndVideoLinks < 4096){
|
||||
; Photo and Video Title go into SendPhoto
|
||||
TelegramVideoTitle := TelegramVideoTitle . "`n" . VideoLinks
|
||||
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
|
||||
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, {
|
||||
; If Title, links and message are longer than 4096 chars, we need to split them into multiple messages
|
||||
@@ -126,7 +138,11 @@ Loop % VideoDescriptionChunks.Length(){
|
||||
Description := VideoDescriptionChunks[A_Index]
|
||||
|
||||
|
||||
SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
|
||||
Status := SendTelegramMessage(TelegramBotToken, TelegramBotChatID, text := Description)
|
||||
; Output returned data to ErrorLog File
|
||||
Message = API Response:`n%Status%
|
||||
SaveOrPostProgress(Message:=Message,PostType:=",ErrorLoggingTextFile")
|
||||
|
||||
; Clipboard := Description
|
||||
; msgbox % Description
|
||||
|
||||
|
||||
Reference in New Issue
Block a user