Amin Rousta
Amin Rousta

Reputation: 97

how to forward a message form channel to another user with bot?

I'd tried forwarding bot received messages for myself. my code works for some channels but doesn't work for other channels.

Are the channels different in telegram ?!!

my code:

$frmmsgid= $update["message"]["forward_from_message_id"];
$frmcht= $update["message"]["forward_from_chat"]["id"];
forward($myId,$frmcht,urlencode($frmmsgid));
function forward($to, $from, $mes)
{
    $url = $GLOBALS['webSite'] . "/forwardMessage?chat_id=" . $to . "&from_chat_id=" . $from . "&message_id=" . $mes;
    $result = file_get_contents($url);
 }

Upvotes: 1

Views: 5268

Answers (1)

Groosha
Groosha

Reputation: 3067

As 91DarioDev mentioned, bots cannot forward message from channels where they aren't admins (bots can't be members of channels, only admins).

Upvotes: 4

Related Questions