<?php
/*
dev: https://factweb.ir
channel telegram : @factwebir
*/
error_reporting(0);
include "config.php";
define('API_KEY',$API_KC); 
#=======================================
$connect->query("CREATE TABLE `adspost` (
  `checkads` varchar(250) DEFAULT NULL,
  `textads` varchar(1200) DEFAULT NULL
)");
$connect->query("INSERT INTO `adspost` (`checkads`, `textads`) VALUES
('off', 'NO')");
#=======================================
$connect->query("CREATE TABLE `channels` (
  `idoruser` varchar(30) PRIMARY KEY,
  `link` varchar(200) NOT NULL
)");
#=======================================
$connect->query("CREATE TABLE `dbremove` (
  `id` bigint(64) NOT NULL,
  `message_id` int(250) NOT NULL,
  `time` int(250) NOT NULL
)");
#=======================================
$connect->query("CREATE TABLE `files` (
  `code` varchar(10) DEFAULT NULL,
  `msg_id` varchar(10) DEFAULT NULL,
  `ghfl_ch` varchar(5) DEFAULT NULL,
  `zd_filter` varchar(5) DEFAULT NULL,
  `id` varchar(20) DEFAULT NULL,
  `dl` varchar(10) DEFAULT NULL,
  `pass` varchar(50) DEFAULT NULL,
  `mahdodl` varchar(10) DEFAULT NULL,
  `zaman` varchar(20) DEFAULT NULL,
  `likes` varchar(10) DEFAULT NULL,
  `dislikes` varchar(10) DEFAULT NULL,
  `file_id` varchar(500) DEFAULT NULL,
  `file_size` varchar(10) DEFAULT NULL,
  `caption` text DEFAULT NULL,
  `type` varchar(10) DEFAULT NULL,
  `thumbnail` text DEFAULT NULL
)");
#=======================================
$connect->query("CREATE TABLE `reaction` (
  `checkreact` varchar(100) DEFAULT NULL,
  `channelreact` varchar(250) DEFAULT NULL,
  `reacttedad` int(11) DEFAULT NULL,
  `timefakereact` int(11) DEFAULT NULL
)");
$connect->query("INSERT INTO `reaction` (`checkreact`, `channelreact`, `reacttedad`, `timefakereact`) VALUES
('off', 'no', 1, 10)");
#=======================================
$connect->query("CREATE TABLE `seen` (
  `checkseen` varchar(10) DEFAULT 'off',
  `channelseen` varchar(20) DEFAULT 'none',
  `adadseen` int(11) DEFAULT 0,
  `timefake` int(11) DEFAULT 10
)");
$connect->query("INSERT INTO `seen` (`checkseen`, `channelseen`, `adadseen`, `timefake`) VALUES
('off', 'no', 10, 5)");
#=======================================
$connect->query("CREATE TABLE `settings` (
  `botid` varchar(30) PRIMARY KEY,
  `bot_mode` varchar(20) NOT NULL,
  `mtn_s_ch` text NOT NULL,
  `chupl` varchar(70) NOT NULL,
  `forall` varchar(20) NOT NULL,
  `sendall` varchar(20) NOT NULL,
  `tedad` varchar(20) NOT NULL,
  `text` text NOT NULL,
  `chat_id` varchar(20) NOT NULL,
  `is_all` varchar(20) NOT NULL,
  `factwebir` varchar(20) NOT NULL,
  `msg_id` varchar(20) NOT NULL,
  `topdlbut` varchar(25) DEFAULT NULL,
  `newdlbut` varchar(25) DEFAULT NULL,
  `supportbut` varchar(25) DEFAULT NULL,
  `sendbut` varchar(25) DEFAULT NULL,
  `starttext` text DEFAULT NULL,
  `subbuy` varchar(5) DEFAULT NULL,
  `accountbut` varchar(5) DEFAULT NULL,
  `bottype` varchar(20) DEFAULT NULL,
  `sub1` text DEFAULT NULL,
  `sub2` text DEFAULT NULL,
  `sub3` text DEFAULT NULL,
  `showlikes` varchar(5) DEFAULT NULL,
  `showdownload` varchar(5) DEFAULT NULL,
  `autoacc` varchar(5) DEFAULT NULL
)");
#=======================================
$connect->query("CREATE TABLE `user` (
  `id` bigint(64) PRIMARY KEY,
  `step` varchar(500) NOT NULL,
  `step2` varchar(500) NOT NULL,
  `step3` varchar(2500) NOT NULL,
  `step4` varchar(500) NOT NULL,
  `step5` varchar(500) NOT NULL,
  `spam` varchar(20) NOT NULL,
  `timejoin` varchar(50) DEFAULT NULL,
  `vip` varchar(50) DEFAULT NULL,
  `viptime` varchar(50) DEFAULT NULL,
  `dl` varchar(50) DEFAULT NULL,
  `expireok` varchar(5) DEFAULT NULL
)");
#=======================================
$connect->query("CREATE TABLE `userfiles` (
  `code` varchar(10) DEFAULT NULL,
  `id` int(20) DEFAULT NULL,
  `file_id` varchar(500) DEFAULT NULL,
  `caption` text DEFAULT NULL,
  `type` varchar(10) DEFAULT NULL
)");
#=======================================
if($settings['botid'] == null ){
    	$connect->query("INSERT INTO `settings` (`botid`, `bot_mode`, `mtn_s_ch`, `chupl`, `forall`, `sendall`, `tedad`, `text`, `chat_id`, `is_all`, `factwebir`, `msg_id`, `topdlbut`, `newdlbut`, `supportbut`, `sendbut`, `starttext`, `subbuy`, `accountbut`, `bottype`, `sub1`, `sub2`, `sub3`, `showlikes`, `showdownload`, `autoacc`) VALUES
('$botid', 'on', 'none', 'none', 'false', 'false', '0', 'none', 'none', 'no', '1', 'no', 'on', 'on', 'on', 'on', 'start', 'off', 'off', 'free', 'sub1^on^30^50000', 'sub2^on^60^50000', 'sub3^on^90^50000', 'on', 'on', 'off')");
} 
echo "<b>جداول ربات با موفقیت ایجاد شد</b>";
