Thursday, June 2, 2022

Telegram - Get Message via VBS

 Dim http,URL


' you can get this json script from post: VBS - Extract JSON

Set fso = CreateObject("Scripting.FileSystemObject")

executeGlobal fso.openTextFile(strPath & "ExtractJSON.vbs" ).readAll()

'=====================


botID = "botxxxxxxx"


URL = "https://api.telegram.org/" & botID & "/getUpdates"

Set http = CreateObject("Msxml2.XMLHTTP")

http.open "GET",URL,False

'http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

http.send


strJson = http.responseText

msgbox strJson ' showing real data from telegram


Result = Extract(strJson,"(\x22(.*)\x22)")

msgbox Result ' showing data from telegram after extract by ExtractJSON

No comments: