【发布时间】:2018-11-12 07:28:58
【问题描述】:
我从 Excel 向电报发送消息。它工作得很好。 但是我怎样才能发送照片?没看懂(https://core.telegram.org/bots/api#sendphoto)
感谢您的帮助!
我的发送消息:
Dim objRequest As Object
Dim strChatId As String
Dim strMessage As String
Dim strPostData As String
Dim strResponse As String
strChatId = Worksheets("Einstellungen").Cells(3, "AB")
strMessage = Report
APIcode = Worksheets("Einstellungen").Cells(2, "AB")
strPostData = "chat_id=" & strChatId & "&text=" & strMessage
Set objRequest = CreateObject("MSXML2.XMLHTTP")
With objRequest
.Open "POST", "https://api.telegram.org/" & APIcode & "/sendMessage?", False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send (strPostData)
GetSessionId = .responseText
End With
【问题讨论】:
标签: vba excel telegram telegram-bot