Skip to content

Commit 712eab6

Browse files
authored
Update bot.php
1 parent dfbf308 commit 712eab6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bot.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5770,13 +5770,13 @@
57705770
$hosts = getMarzbanHosts($serverId)->inbounds;
57715771
$networkType = array();
57725772
foreach($hosts as $key => $inbound){
5773-
$networkType[] = [['text'=>$inbound->tag, 'callback_data'=>"selectHost{$match[1]}_{$inbound->protocol}_{$inbound->tag}"]];
5773+
$networkType[] = [['text'=>$inbound->tag, 'callback_data'=>"selectHost{$match[1]}*_*{$inbound->protocol}*_*{$inbound->tag}"]];
57745774
}
57755775
$networkType[] = [['text'=>$buttonValues['cancel'], 'callback_data'=>"planDetails" . $match[1]]];
57765776
$networkType = json_encode(['inline_keyboard'=>$networkType]);
57775777
editText($message_id, "لطفا نوع شبکه های این پلن را انتخاب کنید",$networkType);
57785778
}
5779-
if(preg_match('/^selectHost(?<planId>\d+)_(?<protocol>.+)_(?<tag>.*)/',$data,$match) && ($from_id == $admin || $userInfo['isAdmin'] == true)){
5779+
if(preg_match('/^selectHost(?<planId>\d+)\*_\*(?<protocol>.+)\*_\*(?<tag>.*)/',$data,$match) && ($from_id == $admin || $userInfo['isAdmin'] == true)){
57805780
$saveBtn = "ذخیره ✅";
57815781
unset($markup[count($markup)-1]);
57825782
if($markup[count($markup)-1][0]['text'] == $saveBtn) unset($markup[count($markup)-1]);
@@ -5800,7 +5800,7 @@
58005800
foreach($markup as $key=>$value){
58015801
$tag = trim(str_replace("", "", $value[0]['text'], $state));
58025802
if($state > 0){
5803-
preg_match('/^selectHost(?<serverId>\d+)_(?<protocol>.+)_(?<tag>.*)/',$value[0]['callback_data'],$info);
5803+
preg_match('/^selectHost(?<serverId>\d+)\*_\*(?<protocol>.+)\*_\*(?<tag>.*)/',$value[0]['callback_data'],$info);
58045804
$inbounds[$info['protocol']][] = $tag;
58055805
$proxies[$info['protocol']] = array();
58065806

@@ -6653,7 +6653,7 @@
66536653
$hosts = getMarzbanHosts($serverId)->inbounds;
66546654
$networkType = array();
66556655
foreach($hosts as $key => $inbound){
6656-
$networkType[] = [['text'=>$inbound->tag, 'callback_data'=>"planNetworkType{$inbound->protocol}_{$inbound->tag}"]];
6656+
$networkType[] = [['text'=>$inbound->tag, 'callback_data'=>"planNetworkType{$inbound->protocol}*_*{$inbound->tag}"]];
66576657
}
66586658
$networkType = json_encode(['inline_keyboard'=>$networkType]);
66596659

@@ -6673,7 +6673,7 @@
66736673
$stmt->close();
66746674

66756675
}
6676-
elseif($step == 5 and $text != $buttonValues['cancel'] && preg_match('/^planNetworkType(?<protocol>.+)_(?<tag>.*)/',$data,$match)){
6676+
elseif($step == 5 and $text != $buttonValues['cancel'] && preg_match('/^planNetworkType(?<protocol>.+)\*_\*(?<tag>.*)/',$data,$match)){
66776677
$saveBtn = "ذخیره ✅";
66786678
if($markup[count($markup)-1][0]['text'] == $saveBtn) unset($markup[count($markup)-1]);
66796679

@@ -6697,7 +6697,7 @@
66976697
foreach($markup as $key=>$value){
66986698
$tag = trim(str_replace("", "", $value[0]['text'], $state));
66996699
if($state > 0){
6700-
preg_match('/^selectHost(?<protocol>.+)_(?<tag>.*)/',$value[0]['callback_data'],$info);
6700+
preg_match('/^planNetworkType(?<protocol>.+)\*_\*(?<tag>.*)/',$value[0]['callback_data'],$info);
67016701
$inbounds[$info['protocol']][] = $tag;
67026702
$proxies[$info['protocol']] = array();
67036703

0 commit comments

Comments
 (0)