reworked discord message formatting, code cleanup
This commit is contained in:
@@ -618,19 +618,6 @@ Return
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
CreateDescriptionForSocialMedia(){
|
|
||||||
SplitText = Free Documentaries:
|
|
||||||
|
|
||||||
SocialMediaDescription := StrSplit(VideoDescription, SplitText)
|
|
||||||
SocialMediaDescription := SocialMediaDescription[1]
|
|
||||||
|
|
||||||
if(strlen(SocialMediaDescription) > 1400){
|
|
||||||
SocialMediaDescription := SubStr(SocialMediaDescription, 1, 1400)
|
|
||||||
SocialMediaDescription .= "..."
|
|
||||||
}
|
|
||||||
|
|
||||||
Return
|
|
||||||
}
|
|
||||||
; -------------------------------Upload Video Functionality-------------------------------
|
; -------------------------------Upload Video Functionality-------------------------------
|
||||||
StartScript:
|
StartScript:
|
||||||
WinGetPos, XPosition, YPosition, , , A
|
WinGetPos, XPosition, YPosition, , , A
|
||||||
|
|||||||
Submodule Lib/Freedomain-Posters-Shared-Functions updated: a3d89a9892...6bf72336d0
@@ -432,7 +432,7 @@ Gui, Add, Button, x%MarginSize% w%ResultsEditAndCopyButtonWidth% h%SecondaryButt
|
|||||||
; Error Log Column
|
; Error Log Column
|
||||||
; ------------------------------------------------
|
; ------------------------------------------------
|
||||||
Gui, Font, s%GuiFontSize%
|
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, Add, Edit,x%ErrorLogEditBoxXPos% h%ErrorLogEditBoxHeight% w%ErrorLogEditBoxWidth% y+10, %ErrorLogVar%
|
||||||
|
|
||||||
gui, font, Normal
|
gui, font, Normal
|
||||||
|
|||||||
@@ -13,23 +13,11 @@ if(DiscordVideosWebhookURL = ""){
|
|||||||
Msgbox, Unable to Grab DiscordVideosWebhookURL from %SettingsIniFilepath%.`nPlease input the URL and then try again.
|
Msgbox, Unable to Grab DiscordVideosWebhookURL from %SettingsIniFilepath%.`nPlease input the URL and then try again.
|
||||||
Return
|
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
|
; https://stackoverflow.com/questions/63160401/how-to-create-hyperlink-in-discord-in-an-embed-in-general
|
||||||
|
|
||||||
|
|
||||||
|
Message :=
|
||||||
|
|
||||||
if(BitChuteURL != "")
|
if(BitChuteURL != "")
|
||||||
Message .= "[BitChute](<" . BitChuteURL . ">) \| "
|
Message .= "[BitChute](<" . BitChuteURL . ">) \| "
|
||||||
|
|
||||||
@@ -55,6 +43,20 @@ if(PodcastNumber != "")
|
|||||||
Message .= "[FDRPodcasts](<" . "https://fdrpodcasts.com/" . 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)
|
Status := UploadImageToDiscord(DiscordVideosWebhookURL, Message, VideoThumbFilepath)
|
||||||
Message = API Response:`n%Status%
|
Message = API Response:`n%Status%
|
||||||
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
|
SaveOrPostProgress(Message:=Message,PostType:="ErrorLoggingTextFile")
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
[Video-Uploader]
|
[Video-Uploader]
|
||||||
Version=3.37
|
Version=3.39
|
||||||
Name=Freedomain Video Uploader
|
Name=Freedomain Video Uploader
|
||||||
|
|||||||
Reference in New Issue
Block a user