arashbeyrami / ARASHHBOT

arash telegram code
1 stars 0 forks source link

G #3

Closed arashbeyrami closed 7 years ago

arashbeyrami commented 7 years ago

Hh

arashbeyrami commented 7 years ago

<?php ob_start(); define('API_KEY','توکن'); function makerequest($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); } } //------- function SendMessage($ChatId, $TextMsg) { seensaz('sendMessage',[ 'chat_id'=>$ChatId, 'text'=>$TextMsg, 'parse_mode'=>"MarkDown" ]); } function SendSticker($ChatId, $sticker_ID) { seensaz('sendSticker',[ 'chat_id'=>$ChatId, 'sticker'=>$sticker_ID ]); } function ForwardMessage($KojaShe,$AzKoja,$KodomMSG) { seensaz('ForwardMessage',[ 'chat_id'=>$KojaShe, 'from_chat_id'=>$AzKoja, 'message_id'=>$KodomMSG ]); } function Save($filename,$TXTdata) { $myfile = fopen($filename, "a+") or die("Unable to open file!"); fwrite($myfile, "$TXTdata"); fclose($myfile); } function objectToArrays($object) { if (!is_object($object) && !is_array($object)) { return $object; } if (is_object($object)) { $object = get_object_vars($object); } return array_map("objectToArrays", $object); } //----////----//---//// $admin = 12345678; mkdir("data/$from_id"); $step = file_get_contents("data/$from_id/step.txt"); $name = $update->message->from->first_name; $username = $update->message->from->username; $from_id = $update->message->from->from_id; $step = file_get_contents('step.txt'); $update = json_decode(file_get_contents('php://input')); $textmessage = $update->message->text; $chat_id = $update->message->chat->id; $code = rand(1,99999999); $message_id = $update->message->message_id; //---//--// if($textmessage == '/start') { makerequest('sendMessage',[ 'chat_id'=>$chat_id, 'text'=>"سلام دوست عزیز خوش آمدید :)", 'reply_markup'=>json_encode([ 'keyboard'=>[ [ ['text'=>"💡ورود به ربات💡"],['text'=>"🌐سازنده ربات🌐"] ], ],'resize_keyboard'=>true ]) ]); } else if($textmessage == "💡ورود به ربات💡") { makerequest('sendMessage',[ 'chat_id'=>$chat_id, 'text'=>"با موفقیت لاگین شدید کد لاگین شما : $code", 'reply_markup'=>json_encode([ 'keyboard'=>[ [ ['text'=>"📣کانال ما📣"] ], ],'resize_keyboard'=>true ]) ]); } else if($textmessage == "🌐سازنده ربات🌐") { makerequest('sendMessage',[ 'chat_id'=>$chat_id, 'text'=> " سازنده ربات

@ARASHKINGMASTER ", ]); } else if($textmessage == "📣کانال ما📣") { makerequest('sendMessage',[ 'chat_id'=>$chat_id, 'text'=> " کانال ما

@Channel ", else if($txt == "عکس") { makerequest('sendphoto',[ 'chat_id'=>$chat_id, 'photo'=>"http://s7.uploads.ru/H8Sbc.jpg", ]); } else { SendMessage($chat_id,"Not Command"); }