<?php
	//===================== آغاز متغیرها =====================
	$myfname = file_get_contents ('data/admin/myfname.txt');
	$myid = file_get_contents ('data/admin/myid.txt');
	$channellink = file_get_contents ('data/admin/channellink.txt');
	$myusername = file_get_contents ('data/admin/myusername.txt');
	//======================================================
	if (!file_exists('data/admin/channellink.txt') or !file_exists('data/admin/myid.txt') or !file_exists('data/admin/myfname.txt') or $channellink == "" or !file_exists('data/admin/myusername.txt')){
		$channel = file_get_contents ("data/admin/channel.txt");
		$me = json_decode(file_get_contents("https://api.telegram.org/bot".token."/getme"));
		$myfname = $me->result->first_name;
		$myid = $me->result->id;
		$myusername = $me->result->username;
		file_put_contents ('data/admin/myusername.txt',$myusername);
		file_put_contents ('data/admin/myid.txt',$myid);
		file_put_contents ('data/admin/myfname.txt',$myfname);
		$channellinkk = json_decode(file_get_contents("https://api.telegram.org/bot".token."/exportChatInviteLink?chat_id=@$channel"));
		$channellink = $channellinkk->result;
		file_put_contents ('data/admin/channellink.txt',$channellink);
	}
	//=====================================================
	$commanda = file_get_contents ("data/admin/commanda.txt");
	$commandu = file_get_contents ("data/users/commandu.txt");
	$invited = file_get_contents ("data/users/$from_id/invited.txt");
	$invitecount = file_get_contents ("data/admin/invitecount.txt");
	//=====================================================
	$update_id = $results->update_id;
	$username = $results->message->from->username;
	$from_id = $results->message->from->id;
	$chat_id = $results->message->chat->id;
	$is_bot = $results->message->from->is_bot;
	$message_id = $results->message->message_id;
	$textmessage = $results->message->text;
	//=====================================================
	$admin = '85522364';
	$id_text = "[$myfname](tg://user?id=$myid)";
	$chat_type = $results->message->chat->type;
	$admin2 = array('85522364','$admin3');
	$admin3 = file_get_contents ("data/admin/adaminz.txt");
	//=====================================================
	$forward_from_message_id = $results->message->forward_from_message_id;
	$data = $results->callback_query->data;
	$channel_post = $results->channel_post;
	$ch_txt = $results->channel_post->text;
	$ch_msg_id = $results->channel_post->message_id;
	$first_name = $results->message->from->first_name;
	$last_name = $results->message->from->last_name;
	//=====================================================
	$fnameS = $results->callback_query->from->first_name;
	$lnameS = $results->callback_query->from->last_name;
	$from_id2 = $results->callback_query->from->id;
	$chat_id2 = $results->callback_query->message->chat->id;
	$message_id2 = $results->callback_query->message->message_id;
	$username2 = $results->callback_query->from->username;
	$callback_query_id = $results->callback_query->id;
	//=====================================================
	$from_reply_id = $results->message->reply_to_message->from->id;
	$from_reply_firstname = $results->message->reply_to_message->from->first_name;
	$from_reply_lastname = $results->message->reply_to_message->from->last_name;
	$sticker = $results->message->sticker;
	$sticker_id = $results->message->sticker->file_id;
	$photo = $results->message->photo;
	$phone_number = $results->message->contact->phone_number;
	$audio = $results->message->audio;
	$document = $results->message->document;
	$video = $results->message->video;
	$voice = $results->message->voice;
	$video_note = $results->message->video_note;
	$location = $results->message->location;
	$gif_id = $results->message->document->file_id;
	$gif_ty = $results->message->document->mime_type;
	$caption = $results->message->caption;
	$video_id = $results->message->video->file_id;
	$voice_id = $results->message->voice->file_id;
	$forward_from_id = $results->message->forward_from->id;
	$first_name_fwd = $results->message->forward_from->first_name;
	$last_name_fwd = $results->message->forward_from->last_name;
	$from_chat_id = $results->message->forward_from_chat->id;
	$is_bot_fwd = $results->message->forward_from->is_bot;
	$chat_type_fwd = $results->message->forward_from_chat->type;
	$fwd_date = $results->message->forward_date;
	$removebot= $results->message->left_chat_participant->id;
	//===================== پایان متغیرها ===================
	
?>