Skip to content

Commit 513ef2d

Browse files
authored
Update bot.php
1 parent 66a7ef9 commit 513ef2d

File tree

1 file changed

+44
-11
lines changed

1 file changed

+44
-11
lines changed

bot.php

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@
11991199
unlink($file);
12001200

12011201
$stmt = $connection->prepare("INSERT INTO `orders_list` VALUES (NULL, ?, '', ?, ?, ?, ?, ?, ?, ?, ?,1, ?, 0);");
1202-
$stmt->bind_param("iiiissisii", $from_id, $id, $server_id, $inbound_id, $remark, $protocol, $expire_date, $vray_link, $price, $data);
1202+
$stmt->bind_param("iiiissisii", $from_id, $id, $server_id, $inbound_id, $remark, $protocol, $expire_date, $vray_link, $price, $date);
12031203
$stmt->execute();
12041204
$order = $stmt->get_result();
12051205
$stmt->close();
@@ -2379,11 +2379,11 @@
23792379

23802380
sendMessage("دسته بندی رو برات حذفش کردم ☹️☑️");
23812381
}
2382-
if(preg_match('/wizwizcategoryedit/',$text) and ($from_id==$admin)){
2382+
if(preg_match('/wizwizcategoryedit/',$text) and ($from_id==$admin) && $text != $cancelText){
23832383
setUser($text);
2384-
sendMessage("〽️ یه اسم جدید برا دسته بندی انتخاب کن:");exit;
2384+
sendMessage("〽️ یه اسم جدید برا دسته بندی انتخاب کن:",$cancelKey);exit;
23852385
}
2386-
if(preg_match('/wizwizcategoryedit(.*)/',$userInfo['step'], $match)){
2386+
if(preg_match('/wizwizcategoryedit(.*)/',$userInfo['step'], $match) && $text != $cancelText){
23872387
$stmt = $connection->prepare("UPDATE `server_categories` SET `title`=? WHERE `id`=?");
23882388
$stmt->bind_param("si", $text, $match[1]);
23892389
$stmt->execute();
@@ -2410,6 +2410,13 @@
24102410
$flagwizwiz = $cty['flag'];
24112411
$remarkwizwiz = $cty['remark'];
24122412
$ucount = $cty['ucount'];
2413+
$stmt = $connection->prepare("SELECT * FROM `server_config` WHERE `id`=?");
2414+
$stmt->bind_param("i", $id);
2415+
$stmt->execute();
2416+
$serverTypeInfo= $stmt->get_result()->fetch_assoc();
2417+
$stmt->close();
2418+
2419+
$serverType = $serverTypeInfo['type']=="sanaei"?"سنایی":"ساده";
24132420
$msg .= "
24142421
❕نام سرور : $cname
24152422
➖➖➖➖➖➖➖➖
@@ -2419,6 +2426,8 @@
24192426
➖➖➖➖➖➖➖➖
24202427
〽️ تعداد : $ucount
24212428
➖➖➖➖➖➖➖➖
2429+
🔅نوعیت سرور : $serverType /changeServerType$id
2430+
➖➖➖➖➖➖➖➖
24222431
🔅ویرایش نام سرور : /editServerName$id
24232432
➖➖➖➖➖➖➖➖
24242433
🔅ویرایش ظرفیت سرور : /editServerMax$id
@@ -2438,8 +2447,24 @@
24382447
}
24392448
sendMessage($msg);
24402449
}
2450+
if(preg_match('/^\/changeServerType(\d+)/',$text,$match) && ($from_id == $admin || $userInfo['isAdmin'] == true)){
2451+
sendMessage("❗️نکته مهم:
24412452
2442-
if($data=='addNewServer' and ($from_id == $admin)){
2453+
⚠️ اگر از پنل سنایی نسخه v1.1.1 و بالاتر استفاده میکنید لطفا نوع پنل را ( سنایی ) انتخاب کنید ، ولی اگر از پنل سنایی نسخه 1.0.9 به قبل و پنل های نیدوکا - وکسیلو ( چینی ) و ... استفاده میکنید نوع پنل را ( ساده ) انتخاب کنید
2454+
   
2455+
",json_encode(['inline_keyboard'=>[
2456+
[['text'=>"ساده",'callback_data'=>"chhangeServerTypenormal_" . $match[1]],['text'=>"سنایی",'callback_data'=>"chhangeServerTypesanaei_" . $match[1]]]
2457+
]]));
2458+
exit();
2459+
}
2460+
if(preg_match('/^chhangeServerType(\w+)_(\d+)/',$data,$match) && ($from_id == $admin || $userInfo['isAdmin'] == true)){
2461+
editText($message_id, "با موفقیت ذخیره شد");
2462+
$stmt = $connection->prepare("UPDATE `server_config` SET `type` = ? WHERE `id`=?");
2463+
$stmt->bind_param("si",$match[1], $match[2]);
2464+
$stmt->execute();
2465+
$stmt->close();
2466+
}
2467+
if($data=='addNewServer' and (($from_id == $admin || $userInfo['isAdmin'] == true))){
24432468
setUser('addserverName');
24442469
sendMessage("مرحله اول:
24452470
▪️یه اسم برا سرورت انتخاب کن:",$cancelKey);
@@ -2492,7 +2517,7 @@
24922517
$data = json_decode($match[1],true);
24932518
$data['panel_url'] = $text;
24942519
setUser('addServerIp' . json_encode($data,JSON_UNESCAPED_UNICODE));
2495-
sendMessage( "🔅 لطفا آیپی پنل را وارد کنید: \n\n❗️ نکته مهم: اگر از تانل یا کلود استفاده می کنید میتوانید ای پی یا دامنه مورد نظرتون رو وارد کنید تا به جای آدرس سرور شما تحویل مشتری داده بشه \n\n🔻برای خالی گذاشتن متن /empty را وارد کنید");
2520+
sendMessage( "🔅 لطفا آیپی پنل را وارد کنید:\n\n🔻برای خالی گذاشتن متن /empty را وارد کنید");
24962521
}
24972522
if(preg_match('/^addServerIp(.*)/',$userInfo['step'],$match) and $text != $cancelText) {
24982523
$data = json_decode($match[1],true);
@@ -2620,9 +2645,18 @@
26202645
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
26212646
$stmt->bind_param("isssssssss", $rowId, $panel_url, $ip, $sni, $header_type, $request_header, $response_header, $security, $tlsSettings, $cookie);
26222647
$stmt->execute();
2648+
$rowId = $stmt->insert_id;
26232649
$stmt->close();
26242650

26252651
sendMessage(" تبریک ; سرورت رو ثبت کردی 🥹",$removeKeyboard);
2652+
2653+
sendMessage("✅ سرور با نوع ساده ثبت شد
2654+
2655+
🔺 اگر از پنل سنایی نسخه v1.1.1 و بالاتر استفاده میکنید لطفا نوع پنل را ( سنایی ) انتخاب کنید ، ولی اگر از پنل سنایی نسخه 1.0.9 به قبل و پنل های نیدوکا - وکسیلو ( چینی ) و ... استفاده میکنید نوع پنل را ( ساده ) انتخاب کنید:
2656+
   
2657+
",json_encode(['inline_keyboard'=>[
2658+
[['text'=>"ساده",'callback_data'=>"chhangeServerTypenormal_" . $rowId],['text'=>"سنایی",'callback_data'=>"chhangeServerTypesanaei_" . $rowId]]
2659+
]]));
26262660
sendMessage('🏵 روی گزینه مورد نظرت کلیک کن:',$adminKeys);
26272661
setUser();
26282662
}
@@ -2639,7 +2673,7 @@
26392673

26402674
sendMessage("🙂 سرور رو چرا حذف کردی اخه ...");
26412675
}
2642-
if(preg_match('/^\/editServer(\D+)(\d+)/',$text,$match)){
2676+
if(preg_match('/^\/editServer(\D+)(\d+)/',$text,$match) && $text != $cancelText){
26432677
switch($match[1]){
26442678
case "Name":
26452679
$txt ="اسم";
@@ -2656,8 +2690,9 @@
26562690
}
26572691
sendMessage("لطفا " . $txt . " جدید را وارد کنید",$cancelKey);
26582692
setUser($text);
2693+
26592694
}
2660-
if(preg_match('/^\/editServer(\D+)(\d+)/',$userInfo['step'],$match)){
2695+
if(preg_match('/^\/editServer(\D+)(\d+)/',$userInfo['step'],$match) && $text != $cancelText){
26612696
switch($match[1]){
26622697
case "Name":
26632698
$txt ="title";
@@ -2677,9 +2712,7 @@
26772712
$stmt->bind_param("si",$text, $match[2]);
26782713
$stmt->execute();
26792714
$stmt->close();
2680-
2681-
2682-
sendMessage("با موفقیت ذخیره شد",$removeKeyboard);
2715+
sendMessage("با موفقیت ذخیره شد");
26832716
setUser();
26842717
}
26852718

0 commit comments

Comments
 (0)