InputBox, message, Enter message to send, Message to send
Gui, Add, Text, , %message%
Gui, Add, Button, w200 h30 gSendMessage, Отправить
Gui, Show
return
SendMessage:
Gui, Submit
; Поменять CHAT_ID и BOT_TOKEN на свои значения
CHAT_ID := "12345678"
BOT_TOKEN := "123456:ABCDEF12345"
message_encoded := UrlEncode(message)
url := "https://api.telegram.org/bot" BOT_TOKEN "/sendMessage?chat_id=" CHAT_ID "&text=" message_encoded
http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
http.open("GET", url, false)
http.send()
if (http.status == 200) {
MsgBox, Message sent successfully.
} else {
MsgBox, Sending message failed.
}
GuiClose:
ExitApp