autohotkey - 通过 TelegramBot 发送消息的自动热键脚本不起作用
问题描述
嗨,我有以下脚本,用于通过电报向自己发送消息。
但是它不起作用。
chatid := "XXXXXXX" ; replace XXXXXXX with your chat_id
text := "test message"
param := "chat_id=" chatid "&text=" text
str =https api.telegram.org /botXXXXXXX/sendmessage? Broken Link for safety ; replace XXXXXXX with your API token
;msgbox, % url_tovar(str, param) ; this is useful if you need to return data
url_tovar(str, param)
url_tovar(URL, param) {
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("POST", URL)
WebRequest.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
WebRequest.Send(param)
res := WebRequest.ResponseText
return res
}
当我运行脚本时,我收到这两条错误消息,然后什么也没有发生。
解决方案
推荐阅读
- python - 从同级目录导入功能(__init__ 文件不起作用)
- tensorflow - Pre_trained model work well on ResNet, InceptionNet but unable to run on VGG16 and VGG19
- firebase - 更新firebase实时数据库xamarin表单中的单个数据
- c - 推广 For 和 Malloc 的大小 C
- r - 如何将颜色图例添加到具有不同几何图层的 ggplot?
- javascript - 在 vuex 中运行以下代码时未定义“mapGetters”
- python - 使用 dropna() 后获取 MultiIndex 级别 0 的名称
- c# - C# -> 如何从文本框中实时读取和打印值
- javascript - 无法从ajax调用中读取未定义的属性“完成”
- c# - 将字节写入文本文件并适当地读取它们