Compare commits

...

4 Commits

Author SHA1 Message Date
Yuriy
f625e782eb removed reusetabs variable. Set to always be enabled 2024-04-17 17:28:54 -04:00
Yuriy
c18e9897ee bug fixes for when there are no errorlog filepath or discord webhook 2024-04-17 17:09:32 -04:00
Yuriy
075859934a bug fixes for when there are no errorlog filepath or discord webhook 2024-04-17 17:09:08 -04:00
Yuriy
88b4b2c119 small cleanup 2024-04-16 22:49:45 -04:00
3 changed files with 15 additions and 8 deletions

View File

@@ -1,10 +1,13 @@
;---FUNCTIONS-----------------------------------------------------------------------
; Misc Functions that are called by both the Video and Social Media poster
; -------------------------------Discord-------------------------------
PostToDiscordChannel(Message,WebhookChannel){
; Don't try to post a message if there is no webhook url
if(WebhookChannel = "")
Return
; Msgbox % "Message: " Message
; Msgbox % "WebhookChannel: " WebhookChannel
@@ -28,8 +31,6 @@ PostToDiscordChannel(Message,WebhookChannel){
}
)
; Msgbox % "JsonString: " JsonString
;
try WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
try WebRequest.Open("POST", WebhookChannel, false)
try WebRequest.SetRequestHeader("Content-Type", "application/json")
@@ -50,14 +51,14 @@ TelegramMsgBox(Text:="", TelegramBotToken := "", TelegramBotChatID :=""){
; Replace all forbidden characters - https://www.ascii-code.com/
; Text := StrReplace(Text, "`%", "%25") ; percent with
Text := StrReplace(Text, "`n", "%0A") ; New Line
; Text := StrReplace(Text, "`n", "%0A") ; New Line
; Text := StrReplace(Text, " ", "%23") ; New Line
; Text :=
; Text := StrReplace(Text, "`n", "%0A") ; New Line
; Text := StrReplace(Text, "`%", "%25") ; percent with
; Msgbox % "Text: " Text
ErrorLoggingPath = %A_ScriptDir%\Lib\ErrorLogging\check.rups
@@ -93,6 +94,7 @@ TelegramMsgBox(Text:="", TelegramBotToken := "", TelegramBotChatID :=""){
; -------------------------------/TelegramAPI-------------------------------
; Telegram Message API
; https://core.telegram.org/bots/api
;------------------------------------------------
SendTelegramMessage(token, chatID, text := "", ParseMode := "MarkdownV2") ; you could add more options; compare the Telegram API docs
{
@@ -142,6 +144,7 @@ pre-formatted fixed-width code block written in the Python programming language
; -------------------------------Telegram Image Sending-------------------------------
; https://www.autohotkey.com/boards/viewtopic.php?t=68417
; https://core.telegram.org/bots/api
SendTelegramPhoto(token, chatID, file, caption := "", ParseMode := "MarkdownV2") ; you could add more options; compare the Telegram API docs
{

View File

@@ -102,6 +102,11 @@ TimedToolTip(Text, x="", y="",RemoveAfterTime:=2000, SetWhichToolTip="") {
; -------------------------------LogErrorsToTextFile-------------------------------
Func_LogErrorsToTextFile(Text){
; Do not log if we do not have an errorlog filepath
if(ErrorLoggingFilePath = "")
return
; ErrorLoggingFile := Filepath
FormatTime, TodayDate , YYYYMMDDHH24MISS, yyyyMMdd_hhmmss
text =

View File

@@ -73,7 +73,6 @@ CheckSeleniumDriver(){
}
DriverStatus := 1
if(ReuseTabs)
CreateArrayOfChromeTabs()