<?php
		if ($textmessage == 'فوروارد همگانی 🔇'  and $commanda == 'none'){
			file_put_contents ("data/admin/commanda.txt",'fwdall');
			sendAction ($from_id,'typing');
			Saeed ('sendMessage',[
				'chat_id'=>$from_id,
				'parse_mode'=>'Markdown',
				'text'=>"پیام خود را فوروارد کنید.",
				'reply_markup'=>json_encode([
					'resize_keyboard'=>true,
					'one_time_keyboard'=>true,
					'keyboard'=>[
						[['text'=>'برگشت 🔙']]
					]
				])
			]);
		}
		if ($commanda == "fwdall" ){
			file_put_contents ("data/admin/commanda.txt","none");
			file_put_contents ('data/admin/msgid.txt',$message_id);
			sendAction ($from_id,'typing');
			Saeed ('sendMessage',[
				'chat_id'=>$from_id,
				'reply_to_message_id'=>$message_id,
				'text'=>"این پیام فوروارد شود؟",
				'reply_markup'=>json_encode([
					'inline_keyboard'=>[
						[['text'=>'آره 👍🏻','callback_data'=>'fwdall'],['text'=>'نه 👎🏻','callback_data'=>'nfwdall']]
					]
				])
			]);
		}
		
		if ($data == 'fwdall'){
			$member = file_get_contents ('data/admin/members.txt');
			$members = explode (",",$member);
			$msgid = file_get_contents ('data/admin/msgid.txt');
			foreach ($members as $chats){
				forwardMessage ($chats,$from_id2,$msgid);	
			}
			Delfile ("data/admin/msgid.txt");
			sendAction ($from_id2,'typing');
			Saeed ('sendMessage',[
				'chat_id'=>$from_id2,
				'text'=>"به همه فوروارد شد.",
				'reply_markup'=>json_encode([
					'resize_keyboard'=>true,
					'one_time_keyboard'=>true,
					'keyboard'=>[
						[['text'=>'برگشت 🔙']],
					]
				])
			]);
			file_put_contents ("data/admin/commanda.txt","none");
		}elseif ($data == 'nfwdall'){
			sendAction ($from_id2,'typing');
			Saeed ('sendMessage',[
				'chat_id'=>$from_id2,
				'text'=>"چیزی فوروارد نشد.",
				'reply_markup'=>json_encode([
					'resize_keyboard'=>true,
					'one_time_keyboard'=>true,
					'keyboard'=>[
						[['text'=>'برگشت 🔙']],
					]
				])
			]);
			Delfile ("data/admin/msgid.txt");
			file_put_contents ("data/admin/commanda.txt","none");
		}

?>