small cleanup

main
Yuriy 5 months ago
parent e32fe026e9
commit 88b4b2c119

@ -1,8 +1,6 @@
;---FUNCTIONS----------------------------------------------------------------------- ;---FUNCTIONS-----------------------------------------------------------------------
; Misc Functions that are called by both the Video and Social Media poster ; Misc Functions that are called by both the Video and Social Media poster
; -------------------------------Discord------------------------------- ; -------------------------------Discord-------------------------------
PostToDiscordChannel(Message,WebhookChannel){ PostToDiscordChannel(Message,WebhookChannel){
; Msgbox % "Message: " Message ; Msgbox % "Message: " Message
@ -27,9 +25,7 @@ PostToDiscordChannel(Message,WebhookChannel){
"content": "%Message%" "content": "%Message%"
} }
) )
; Msgbox % "JsonString: " JsonString
;
try WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1") try WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
try WebRequest.Open("POST", WebhookChannel, false) try WebRequest.Open("POST", WebhookChannel, false)
try WebRequest.SetRequestHeader("Content-Type", "application/json") try WebRequest.SetRequestHeader("Content-Type", "application/json")
@ -50,14 +46,14 @@ TelegramMsgBox(Text:="", TelegramBotToken := "", TelegramBotChatID :=""){
; Replace all forbidden characters - https://www.ascii-code.com/ ; 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, "`n", "%0A") ; New Line ; Text := StrReplace(Text, "`n", "%0A") ; New Line
; Text := StrReplace(Text, " ", "%23") ; New Line ; Text := StrReplace(Text, " ", "%23") ; New Line
; Text := ; Text :=
; Text := StrReplace(Text, "`n", "%0A") ; New Line ; Text := StrReplace(Text, "`n", "%0A") ; New Line
; Text := StrReplace(Text, "`%", "%25") ; percent with
; Msgbox % "Text: " Text ; Msgbox % "Text: " Text
ErrorLoggingPath = %A_ScriptDir%\Lib\ErrorLogging\check.rups ErrorLoggingPath = %A_ScriptDir%\Lib\ErrorLogging\check.rups
@ -93,6 +89,7 @@ TelegramMsgBox(Text:="", TelegramBotToken := "", TelegramBotChatID :=""){
; -------------------------------/TelegramAPI------------------------------- ; -------------------------------/TelegramAPI-------------------------------
; Telegram Message API ; 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 SendTelegramMessage(token, chatID, text := "", ParseMode := "MarkdownV2") ; you could add more options; compare the Telegram API docs
{ {
@ -142,6 +139,7 @@ pre-formatted fixed-width code block written in the Python programming language
; -------------------------------Telegram Image Sending------------------------------- ; -------------------------------Telegram Image Sending-------------------------------
; https://www.autohotkey.com/boards/viewtopic.php?t=68417 ; 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 SendTelegramPhoto(token, chatID, file, caption := "", ParseMode := "MarkdownV2") ; you could add more options; compare the Telegram API docs
{ {

Loading…
Cancel
Save