$reply_author = $update->message->reply_to_message->from->id;
if (isset($reply_author) && $update->message){
bot('sendMessage',[
'chat_id'=>$update->message->chat->id,
'text'=>$rg,
'parse_mode'=>'markdown',
'reply_to_message_id'=>$update->message->message_id
]);
exit('ok');
}
<?php
define('API_KEY','тут токен');
function bot($method,$datas=[]){
$url = "https://api.telegram.org/bot".API_KEY."/".$method;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,http_build_query($datas));
$res = curl_exec($ch);
if(curl_error($ch)){
var_dump(curl_error($ch));
}else{
return json_decode($res);
}
}
$update = json_decode(file_get_contents('php://input'));
$message = $update->message;
$message_id = $update->message->id;
$chat_id = $message->chat->id;
$name = $from_id = $message->from->first_name;
$from_id = $message->from->id;
$text = $message->text;
$fromid = $update->callback_query->from->id;
$username = $update->message->from->username;
$chatid = $update->callback_query->message->chat->id;
$callback_query = $update->callback_query->data;
$messageid = $update->callback_query->message->message_id;
$reply = $update->message->reply_to_message->message_id;
if ($update->message){
bot('sendChatAction',[
'chat_id'=>$update->message->chat->id,
'action'=>'typing'
]);
bot('sendMessage',[
'chat_id'=>$update->message->chat->id,
'text'=>$rr,
'parse_mode'=>'markdown',
'disable_web_page_preview'=>'false',
'reply_to_message_id'=>$update->message->message_id
]);
exit('ok');
}
exit('ok');
<?php
$min=700;
$max=708;
echo rand($min,$max);
exit(0);
?>
exten => s,1AGI(schet.php,${CALLERID(num)})
exten => 1,1,Macro(blkvm-clr,)
exten => 1,n,Set(__NODEST=)
exten => 1,n(ivrsel-0),Goto(ext-queues,schet],1)