一个cURL到达了bot,另一个没有到达-为什么

问题描述

我有一个Telegram机器人,并且正在使用cURL对其进行测试。 我发送了2条cURL消息,其中一条被bot接受,而不是第二条:

echo -e "\n* ok *"
curl -s -X POST -d chat_id=${ID} -d text="${MENSAJE}" ${URL_sndmsg}
echo -e "\n* ko *"
curl -s -X POST -H 'Content-Type: application/json' -d '{"chat_id":"${ID}","text":"${MENSAJE}"}' ${URL_sndmsg} 

结果是:

* ok *
{"ok":true,"result":{"message_id":750,"from":{"id":1136067683,"is_bot":true,"first_name":"mars_ubuntu","username":"mars_super_bot"},"chat":{"id":304588090,"first_name":"Sebastia","last_name":"Altemir","type":"private"},"date":1598689697,"text":"La RaspBerry te saluda."}}
* ko *
{"ok":false,"error_code":400,"description":"Bad Request: chat not found"}

chat-id被硬编码成几行,因此它没有改变...

有任何线索吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)