I want to run a support telegram bot, that user send message to bot and bot send it to admin's account. And when admin replied a message it will send it to user.
$telegram = new telegram(TOKEN);
$result = $telegram->recivedText();
$userid = $result->message->from->id;
$text = $result->message->text;
if ($userid != '665467300' )
{
$telegram->sendMessage('665467300',$text);
}
else
{
$userid = $result->message->reply_to_message->from->id;
$text = $result->message->text;
$telegram->sendMessage($userid,$text);
}
but the problem is here the "else" doesn't work and don't send a message after reply to user.
$result->message->reply_to_message->from->id? It looks like to me it will be the id of the bot, instead of the original user's - William Chong