Telegram Bot Api: Chat_id 在 forwardMessage 方法中不被接受
Telegram Bot Api: Chat_id is not accepted in forwardMessage Method
我正在尝试在电报机器人 API 中转发消息。它显示 "Bad Request: chat_id is empty" 尽管在 sendMessage 中使用相同的 chat_id 并且工作得很好。
要求的方法
https://api.telegram.org/bot{BOT_TOKEN}/forwardMessage?chat_id={CHAT_ID}&from_chat_id={ID}&message_id={MID}
结果:
{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}
更新
在此 link。
的 sendPhoto 和 sendDocument 中报告了类似问题的错误
根据您提供的信息,很难判断是什么不起作用。
我只能说我可以转发这样的消息
$post = array("from_chat_id" => $from_chat, "chat_id" => $to_chat, "message_id" => $m_id);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.telegram.org/bot" . $token . "/forwardMessage");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_exec ($ch);
curl_close ($ch);
我正在尝试在电报机器人 API 中转发消息。它显示 "Bad Request: chat_id is empty" 尽管在 sendMessage 中使用相同的 chat_id 并且工作得很好。
要求的方法
https://api.telegram.org/bot{BOT_TOKEN}/forwardMessage?chat_id={CHAT_ID}&from_chat_id={ID}&message_id={MID}
结果:
{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}
更新
在此 link。
的 sendPhoto 和 sendDocument 中报告了类似问题的错误根据您提供的信息,很难判断是什么不起作用。
我只能说我可以转发这样的消息
$post = array("from_chat_id" => $from_chat, "chat_id" => $to_chat, "message_id" => $m_id);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.telegram.org/bot" . $token . "/forwardMessage");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_exec ($ch);
curl_close ($ch);