Arman
Arman

Reputation: 467

Telegram Bot Api: Chat_id is not accepted in forwardMessage Method

I am trying to forward a message in telegram bot API. It shows "Bad Request: chat_id is empty" despite using same chat_id in sendMessage and works perfectly fine.

Requested Method

https://api.telegram.org/bot{BOT_TOKEN}/forwardMessage?chat_id={CHAT_ID}&from_chat_id={ID}&message_id={MID}

Result:

{"ok":false,"error_code":400,"description":"Bad Request: chat_id is empty"}

Updates

There is a reported bug for similar problem in sendPhoto and sendDocument at this link.

Upvotes: 2

Views: 2264

Answers (1)

Maak
Maak

Reputation: 5038

By the information you're providing it's hard to tell what isn't working.
All i can say is that I can forward messages like this

$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); 

Upvotes: 1

Related Questions