reworked discord message formatting, code cleanup
This commit is contained in:
@@ -432,7 +432,7 @@ Gui, Add, Button, x%MarginSize% w%ResultsEditAndCopyButtonWidth% h%SecondaryButt
|
||||
; Error Log Column
|
||||
; ------------------------------------------------
|
||||
Gui, Font, s%GuiFontSize%
|
||||
Gui, Add, Button, x+%MarginSize% y%MarginSize% w%ErrorLogEditBoxWidth% h%ButtonHeights% y%MarginSize%, Error Log
|
||||
Gui, Add, Button, x+%MarginSize% y%MarginSize% w%ErrorLogEditBoxWidth% h%ButtonHeights% y%MarginSize% gOpenErrorLog, Error Log (Click to Open Detailed Log)
|
||||
Gui, Add, Edit,x%ErrorLogEditBoxXPos% h%ErrorLogEditBoxHeight% w%ErrorLogEditBoxWidth% y+10, %ErrorLogVar%
|
||||
|
||||
gui, font, Normal
|
||||
|
||||
@@ -13,23 +13,11 @@ if(DiscordVideosWebhookURL = ""){
|
||||
Msgbox, Unable to Grab DiscordVideosWebhookURL from %SettingsIniFilepath%.`nPlease input the URL and then try again.
|
||||
Return
|
||||
}
|
||||
|
||||
/*
|
||||
; If description is longer than 2k chars, then API will error out. goto section that will allow user to edit video description to shorten it for posting
|
||||
if(StrLen(SocialMediaDescription) > 2000 AND VideoDescriptionForVideosChannel = ""){
|
||||
Goto, CreateDescriptionForVideosPosting
|
||||
}
|
||||
|
||||
*/
|
||||
if(SocialMediaDescription = ""){
|
||||
CreateDescriptionForSocialMedia()
|
||||
}
|
||||
|
||||
|
||||
SubmitDescriptionForDiscordVideosChannel:
|
||||
Message := "**" . VideoTitle . "**" . "`n" . SocialMediaDescription . "`n"
|
||||
; https://stackoverflow.com/questions/63160401/how-to-create-hyperlink-in-discord-in-an-embed-in-general
|
||||
|
||||
|
||||
Message :=
|
||||
|
||||
if(BitChuteURL != "")
|
||||
Message .= "[BitChute](<" . BitChuteURL . ">) \| "
|
||||
|
||||
@@ -55,6 +43,20 @@ if(PodcastNumber != "")
|
||||
Message .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . PodcastNumber . ">) \| "
|
||||
|
||||
|
||||
; StrLenOfDiscordMessage :=
|
||||
|
||||
; trim the video description if Title + Body + Links is longer than 2000 chars
|
||||
if((StrLen(VideoTitle) + StrLen(VideoDescription) + StrLen(Message)) > 2000){
|
||||
|
||||
DiscordAPICharsLeft := 2000 - StrLen(VideoTitle) - StrLen(Message) - 15
|
||||
|
||||
DiscordVideoDescription := SubStr(VideoDescription, 1, DiscordAPICharsLeft) . "..."
|
||||
}
|
||||
else,
|
||||
DiscordVideoDescription := VideoDescription
|
||||
|
||||
Message := "**" . VideoTitle . "**" . "`n" . DiscordVideoDescription . "`n" . Message
|
||||
|
||||
Status := UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
|
||||
Message = API Response:`n%Status%
|
||||
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
|
||||
|
||||
Reference in New Issue
Block a user