تیکه کد تایید شماره (جیسون)
متغیرهای زیر رو در کنار بقیه متغیر ها بزارید
$step = $user['step'];
$user = json_decode(file_get_contents("data/$from_id/settings.json"),true);
کد زیر رو هر جایی که نیاز بود که طرف شمارشو تایید کنه بزنید
if($user['phone'] != null){
}else{
$user['step'] = "phone";
file_put_contents("data/$from_id/settings.json",json_encode($user));
bot('sendmessage',[
'chat_id'=>$chat_id,
'text'=>"ما نیاز به تایید هوین شما داریم لطفاهویت خود را تایید کنید🙏➰",
'reply_markup' => json_encode([
'resize_keyboard'=>true,
'keyboard' => [
[['text'=>" تایید هویت",'request_contact'=>true]]
],
])
]);
}
اینم پایین تر از استارت قرار بدید✔️
elseif($step == "phone" and isset($message->contact)){
if($update->message->contact->user_id == $from_id){
$phone_number =$message->contact->phone_number;
$user['step'] = "none";
$user['phone'] = "+$phone_number";
file_put_contents("data/$from_id/settings.json",json_encode($user));
SendMessage($chat_id,"هویت شما تایید شد", null, $message_id);
SendMessage($chat_id,"لطفا از گزینه های زیر استفاده کنید ");
}else{
bot('sendmessage',[
'chat_id'=>$chat_id,
'text'=>"فقط از دکمه زیر میتوانید هویت خود را تایید کنید",
'reply_markup' => json_encode([
'resize_keyboard'=>true,
'keyboard' => [
[['text'=>" تایید هویت",'request_contact'=>true]]
],
])
]);
}
}
کپی بدون ذکر منبع نزن عزیزم ❤️
🆔 @Star_Sourcee
Post #160
1.3K